changeset 1929:95101fe50e49

fix ordering of RegistryContent.Entry
author Cheer Xiao <xiaqqaix@gmail.com>
date Sat, 02 Feb 2013 11:57:33 +0800
parents b97f0a329819
children 41c8fbd0abc6
files MoinMoin/items/content.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/items/content.py	Thu Jan 31 14:30:15 2013 +0800
+++ b/MoinMoin/items/content.py	Sat Feb 02 11:57:33 2013 +0800
@@ -82,7 +82,10 @@
 
         def __lt__(self, other):
             if isinstance(other, self.__class__):
-                return (self.content_type, self.priority) < (other.content_type, other.priority)
+                # Within the registry, content_type is sorted in descending
+                # order (more specific first) while priority is in ascending
+                # order (smaller first).
+                return (other.content_type, self.priority) < (self.content_type, other.priority)
             return NotImplemented
 
     def __init__(self, group_names):