mirror of https://gitlab.crans.org/bde/nk20
commit
e366f37ee3
|
@ -46,6 +46,7 @@ class Profile(models.Model):
|
||||||
class Meta:
|
class Meta:
|
||||||
verbose_name = _('user profile')
|
verbose_name = _('user profile')
|
||||||
verbose_name_plural = _('user profile')
|
verbose_name_plural = _('user profile')
|
||||||
|
indexes = [ models.Index(fields=['user']) ]
|
||||||
|
|
||||||
def get_absolute_url(self):
|
def get_absolute_url(self):
|
||||||
return reverse('user_detail', args=(self.pk,))
|
return reverse('user_detail', args=(self.pk,))
|
||||||
|
@ -152,6 +153,7 @@ class Membership(models.Model):
|
||||||
class Meta:
|
class Meta:
|
||||||
verbose_name = _('membership')
|
verbose_name = _('membership')
|
||||||
verbose_name_plural = _('memberships')
|
verbose_name_plural = _('memberships')
|
||||||
|
indexes = [ models.Index(fields=['user']) ]
|
||||||
|
|
||||||
# @receiver(post_save, sender=settings.AUTH_USER_MODEL)
|
# @receiver(post_save, sender=settings.AUTH_USER_MODEL)
|
||||||
# def save_user_profile(instance, created, **_kwargs):
|
# def save_user_profile(instance, created, **_kwargs):
|
||||||
|
|
|
@ -209,6 +209,10 @@ class Alias(models.Model):
|
||||||
class Meta:
|
class Meta:
|
||||||
verbose_name = _("alias")
|
verbose_name = _("alias")
|
||||||
verbose_name_plural = _("aliases")
|
verbose_name_plural = _("aliases")
|
||||||
|
indexes = [
|
||||||
|
models.Index(fields=['name']),
|
||||||
|
models.Index(fields=['normalized_name']),
|
||||||
|
]
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.name
|
return self.name
|
||||||
|
|
|
@ -119,6 +119,11 @@ class Transaction(PolymorphicModel):
|
||||||
class Meta:
|
class Meta:
|
||||||
verbose_name = _("transaction")
|
verbose_name = _("transaction")
|
||||||
verbose_name_plural = _("transactions")
|
verbose_name_plural = _("transactions")
|
||||||
|
indexes = [
|
||||||
|
models.Index(fields=['created_at']),
|
||||||
|
models.Index(fields=['source']),
|
||||||
|
models.Index(fields=['destination']),
|
||||||
|
]
|
||||||
|
|
||||||
def save(self, *args, **kwargs):
|
def save(self, *args, **kwargs):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue