diff options
| author | Étienne Loks <etienne.loks@proxience.com> | 2014-07-25 10:07:04 +0200 | 
|---|---|---|
| committer | Étienne Loks <etienne.loks@proxience.com> | 2014-07-25 10:07:04 +0200 | 
| commit | 048f8b139fdbb54fd24dcf862eb3f2e928aa9d28 (patch) | |
| tree | c68a0ea9ceaa05a480b3e39b9c9518b1f2df710b | |
| parent | caa6c616328807b1fb397de75c54e271bad38c87 (diff) | |
| download | Ishtar-048f8b139fdbb54fd24dcf862eb3f2e928aa9d28.tar.bz2 Ishtar-048f8b139fdbb54fd24dcf862eb3f2e928aa9d28.zip  | |
Rollback to alphabetic order for short menu (refs #1562)
| -rw-r--r-- | archaeological_files/models.py | 3 | ||||
| -rw-r--r-- | archaeological_operations/models.py | 3 | 
2 files changed, 3 insertions, 3 deletions
diff --git a/archaeological_files/models.py b/archaeological_files/models.py index bbced9a59..0be5f4d05 100644 --- a/archaeological_files/models.py +++ b/archaeological_files/models.py @@ -227,8 +227,7 @@ class File(BaseHistorizedItem, OwnPerms, ValueGetter, ShortMenuItem):      @classmethod      def get_owns(cls, user):          owns = super(File, cls).get_owns(user) -        return sorted(owns.all(), key=lambda x:(x.name, -x.year, -                                                x.numeric_reference)) +        return sorted(owns.all(), key=lambda x:x.cached_label)      @classmethod      def get_years(cls): diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py index 2c148366b..e27e5c0dc 100644 --- a/archaeological_operations/models.py +++ b/archaeological_operations/models.py @@ -229,7 +229,8 @@ class Operation(BaseHistorizedItem, OwnPerms, ValueGetter, ShortMenuItem):      def get_owns(cls, user):          owns = super(Operation, cls).get_owns(user)          #owns = owns.annotate(null_count=Count('operation_code')) -        return owns.order_by("common_name", "-year", "operation_code") +        #return owns.order_by("common_name", "-year", "operation_code") +        return sorted(owns.all(), key=lambda x:x.cached_label)      def __unicode__(self):          if self.cached_label:  | 
