[Erp5-report] r31542 fabien - /erp5/trunk/products/ERP5/mixin/cached_convertable.py

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Dec 30 17:49:33 CET 2009


Author: fabien
Date: Wed Dec 30 17:49:32 2009
New Revision: 31542

URL: http://svn.erp5.org?rev=31542&view=rev
Log:
getConversion return 2 values not only one

getConversion return a list of two values, so previous code ("return
len(self.getConversion(**kw))") always return 2.
Now the len of the data is returned.
In case of images, data is an OFSImage object. But OFSImage objects support
len, so it works also in case of images.

Modified:
    erp5/trunk/products/ERP5/mixin/cached_convertable.py

Modified: erp5/trunk/products/ERP5/mixin/cached_convertable.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/mixin/cached_convertable.py?rev=31542&r1=31541&r2=31542&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/mixin/cached_convertable.py [utf8] (original)
+++ erp5/trunk/products/ERP5/mixin/cached_convertable.py [utf8] Wed Dec 30 17:49:32 2009
@@ -161,7 +161,8 @@
     """
     """
     try:
-      return len(self.getConversion(**kw))
+      mime, data = self.getConversion(**kw)
+      return len(data)
     except KeyError:
       return 0
 




More information about the Erp5-report mailing list