diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-03-13 17:02:11 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-03-13 17:02:11 +0100 |
commit | 7064eb09e1548633d991b501b13d59469339fb46 (patch) | |
tree | 7f6503eae9fbece2f9f23c33adb1bd20adb6a429 /ishtar_common/models.py | |
parent | f0efbc44b9dfbd648c17b4d82937e725431cdf5b (diff) | |
download | Ishtar-7064eb09e1548633d991b501b13d59469339fb46.tar.bz2 Ishtar-7064eb09e1548633d991b501b13d59469339fb46.zip |
Sources: ordering author by author type (refs #3359)
Diffstat (limited to 'ishtar_common/models.py')
-rw-r--r-- | ishtar_common/models.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 3b3f9d141..ca6ba36c9 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -2843,10 +2843,11 @@ IshtarUser._meta.get_field('password').help_text = _( class AuthorType(GeneralType): + order = models.IntegerField(_(u"Order"), default=1) class Meta: verbose_name = _(u"Author type") verbose_name_plural = _(u"Author types") - ordering = ['label'] + ordering = ['order', 'label'] post_save.connect(post_save_cache, sender=AuthorType) post_delete.connect(post_save_cache, sender=AuthorType) @@ -2859,6 +2860,7 @@ class Author(models.Model): class Meta: verbose_name = _(u"Author") verbose_name_plural = _(u"Authors") + ordering = ('author_type__order', 'person__name') def __unicode__(self): return unicode(self.person) + settings.JOINT + \ |