Skip to content
Snippets Groups Projects
Commit c8f5451e authored by Benjamin Graillot's avatar Benjamin Graillot
Browse files

Added indexes for Transaction, Alias and Profile

parent 77551162
No related branches found
No related tags found
1 merge request!55Index
Pipeline #7912 passed with warnings with stages
in 4 minutes and 42 seconds
......@@ -46,6 +46,7 @@ class Profile(models.Model):
class Meta:
verbose_name = _('user profile')
verbose_name_plural = _('user profile')
indexes = [ models.Index(fields=['user']) ]
def get_absolute_url(self):
return reverse('user_detail', args=(self.pk,))
......
......@@ -209,6 +209,10 @@ class Alias(models.Model):
class Meta:
verbose_name = _("alias")
verbose_name_plural = _("aliases")
indexes = [
models.Index(fields=['name']),
models.Index(fields=['normalized_name']),
]
def __str__(self):
return self.name
......
......@@ -119,6 +119,11 @@ class Transaction(PolymorphicModel):
class Meta:
verbose_name = _("transaction")
verbose_name_plural = _("transactions")
indexes = [
models.Index(fields=['created_at']),
models.Index(fields=['source']),
models.Index(fields=['destination']),
]
def save(self, *args, **kwargs):
"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment