Do ordering the django way

parent 77296e1a
Pipeline #43504 passed with stage
in 4 minutes and 52 seconds
......@@ -238,6 +238,7 @@ class Person(PermissionsMixin, models.Model):
class Meta:
db_table = "person"
ordering = ('cn', 'mn', 'sn')
objects = PersonManager()
......@@ -287,9 +288,6 @@ class Person(PermissionsMixin, models.Model):
pending = models.CharField("Nonce used to confirm this pending record", max_length=255, unique=False, blank=True)
last_vote = models.DateField(null=True, blank=True, help_text=_("date of the last vote done with this uid"))
def __lt__(self, other):
return self.fullname < other.fullname
def clean_fields(self, exclude=None, *args, **kw):
super().clean_fields(exclude=exclude, *args, **kw)
if not exclude or "uid" not in exclude:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment