[Checkins] SVN: z3c.dobbin/trunk/src/z3c/dobbin/mapper.py Added mapper comparison method.

Malthe Borch mborch at gmail.com
Sat Jun 21 20:41:45 EDT 2008


Log message for revision 87643:
  Added mapper comparison method.

Changed:
  U   z3c.dobbin/trunk/src/z3c/dobbin/mapper.py

-=-
Modified: z3c.dobbin/trunk/src/z3c/dobbin/mapper.py
===================================================================
--- z3c.dobbin/trunk/src/z3c/dobbin/mapper.py	2008-06-21 23:17:27 UTC (rev 87642)
+++ z3c.dobbin/trunk/src/z3c/dobbin/mapper.py	2008-06-22 00:41:42 UTC (rev 87643)
@@ -200,6 +200,12 @@
             self.uuid = uuid()
             self.spec = self.__spec__
 
+        def __cmp__(self, other):
+            if IMapped.providedBy(other):
+                return cmp(self.id, other.id)
+            else:
+                return -1
+
     # if the specification is an interface class, try to look up a
     # security checker and define it on the mapper
     if interface.interfaces.IInterface.providedBy(spec):



More information about the Checkins mailing list