Add __lt__ method necessary for usage of sorted() later in the file.

This commit is contained in:
Ryan Stein 2017-10-29 22:10:16 -04:00
parent be5ecf0d0d
commit a4b902108c

View file

@ -66,6 +66,9 @@ class Tag(models.Model):
unique_together = (('db_key', 'db_category', 'db_tagtype', 'db_model'),)
index_together = (('db_key', 'db_category', 'db_tagtype', 'db_model'),)
def __lt__(self, other):
return str(self) < str(other)
def __unicode__(self):
return "<Tag: %s%s>" % (self.db_key, "(category:%s)" % self.db_category if self.db_category else "")