[Erp5-report] r31521 aurel - /erp5/trunk/products/ERP5Type/Accessor/Content.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Dec 29 16:49:56 CET 2009


Author: aurel
Date: Tue Dec 29 16:49:55 2009
New Revision: 31521

URL: http://svn.erp5.org?rev=31521&view=rev
Log:
fix call method content accessors for *list
- use contentValues instead of searchFolder
- call contentValues on object instance and not on accessor itself
- call getter instead of accessing property directly


Modified:
    erp5/trunk/products/ERP5Type/Accessor/Content.py

Modified: erp5/trunk/products/ERP5Type/Accessor/Content.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Accessor/Content.py?rev=31521&r1=31520&r2=31521&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Accessor/Content.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/Accessor/Content.py [utf8] Tue Dec 29 16:49:55 2009
@@ -117,7 +117,8 @@
 
     def __call__(self, instance, *args, **kw):
       # We return the list of matching objects
-      return [o.getObject() for o in self.contentValues({'portal_type': self._portal_type, 'id': self._storage_id})]
+      return instance.contentValues(filter = {'portal_type': self._portal_type,
+                                              'id' : self._storage_id})
 
     psyco.bind(__call__)
 
@@ -198,7 +199,9 @@
 
     def __call__(self, instance, *args, **kw):
       # We return the list of matching objects
-      return [o.relative_url for o in self.searchFolder(portal_type = self._portal_type, id = self._storage_id)]
+        return [o.getRelativeUrl() for o in
+                instance.contentValues(filter = {'portal_type': self._portal_type,
+                                                 'id' : self._storage_id})]
 
     psyco.bind(__call__)
 




More information about the Erp5-report mailing list