[CMF-checkins] CVS: CMF/CMFWorkspaces - Workspace.py:1.2

Shane Hathaway shane@cvs.zope.org
Wed, 22 May 2002 13:02:40 -0400


Update of /cvs-repository/CMF/CMFWorkspaces
In directory cvs.zope.org:/tmp/cvs-serv27467

Modified Files:
	Workspace.py 
Log Message:
Working content rows display


=== CMF/CMFWorkspaces/Workspace.py 1.1.1.1 => 1.2 ===
 
     security.declareProtected(ManageWorkspaces, 'listReferencedItems')
-    def listReferencedItems(self, sort_attr='Title', sort_direction='up'):
+    def listReferencedItems(self, sort_attr='Title', sort_order='normal'):
         """Returns a list of pairs containing (collection_id, object)."""
         if not sort_attr in self._allowed_sort_attrs:
             raise ValueError, "'%s' is not a valid sort attribute." % sort_attr
-        if not sort_direction in ('up', 'down'):
+        if not sort_order in ('normal', 'reverse'):
             raise ValueError, (
-                "'%s' is not a valid sort direction." % sort_direction)
+                "'%s' is not a valid sort order." % sort_order)
         seq = []
         for cid, ref in self._refs.items():
             ob = ref.dereferenceDefault(self)
@@ -140,7 +140,7 @@
             seq.append((sort_key, cid, ob))
 
         seq.sort()
-        if sort_direction == 'down':
+        if sort_order == 'reverse':
             seq.reverse()
 
         return map(lambda item: item[1:], seq)