[Checkins] SVN: Products.ZCatalog/trunk/ add __eq__ operator to catalog brains by comparing record ids
Elizabeth Leddy
elizabeth.leddy at gmail.com
Fri Jun 10 20:58:01 EDT 2011
Log message for revision 121906:
add __eq__ operator to catalog brains by comparing record ids
Changed:
U Products.ZCatalog/trunk/CHANGES.txt
U Products.ZCatalog/trunk/src/Products/ZCatalog/CatalogBrains.py
-=-
Modified: Products.ZCatalog/trunk/CHANGES.txt
===================================================================
--- Products.ZCatalog/trunk/CHANGES.txt 2011-06-10 14:53:03 UTC (rev 121905)
+++ Products.ZCatalog/trunk/CHANGES.txt 2011-06-11 00:57:58 UTC (rev 121906)
@@ -5,6 +5,8 @@
--------------------
- Fixed BooleanIndex' items method so the ZMI browse view works.
+- Added eq comparison for brains (completely convenience)
+ [eleddy]
2.13.14 (2011-05-19)
--------------------
Modified: Products.ZCatalog/trunk/src/Products/ZCatalog/CatalogBrains.py
===================================================================
--- Products.ZCatalog/trunk/src/Products/ZCatalog/CatalogBrains.py 2011-06-10 14:53:03 UTC (rev 121905)
+++ Products.ZCatalog/trunk/src/Products/ZCatalog/CatalogBrains.py 2011-06-11 00:57:58 UTC (rev 121906)
@@ -32,6 +32,10 @@
def __contains__(self, name):
return name in self.__record_schema__
+
+ def __eq__(self, other):
+ """If two records have the same rid they are the same"""
+ return self.getRID() == other.getRID()
def getPath(self):
"""Get the physical path for this record"""
More information about the checkins
mailing list