[Erp5-report] r17208 - /erp5/trunk/products/ERP5Type/XMLMatrix.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Fri Oct 26 17:19:44 CEST 2007
Author: romain
Date: Fri Oct 26 17:19:43 2007
New Revision: 17208
URL: http://svn.erp5.org?rev=17208&view=rev
Log:
Check index existence on aq_base to prevent acquisition.
Modified:
erp5/trunk/products/ERP5Type/XMLMatrix.py
Modified: erp5/trunk/products/ERP5Type/XMLMatrix.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/XMLMatrix.py?rev=17208&r1=17207&r2=17208&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/XMLMatrix.py (original)
+++ erp5/trunk/products/ERP5Type/XMLMatrix.py Fri Oct 26 17:19:43 2007
@@ -68,7 +68,7 @@
Access a cell at row and column
"""
base_id= kwd.get('base_id', "cell")
- if not hasattr(self, 'index'):
+ if not hasattr(aq_base(self), 'index'):
return None
if not self.index.has_key(base_id):
@@ -105,7 +105,7 @@
Checks if matrix corresponding to base_id contains cell specified
by *kw coordinates.
"""
- if not hasattr(self, 'index'):
+ if not hasattr(aq_base(self), 'index'):
return 0
base_id= kwd.get('base_id', "cell")
@@ -134,7 +134,7 @@
"""
aq_self = aq_base(self)
- if not hasattr(self, 'index'):
+ if not hasattr(aq_self, 'index'):
return 0
if not self.index.has_key(base_id):
@@ -153,7 +153,7 @@
Checks if *kw coordinates are in the range of the
matrix in kwd['base_id'].
"""
- if not hasattr(self, 'index'):
+ if not hasattr(aq_base(self), 'index'):
return 0
base_id = kwd.get('base_id', "cell")
@@ -372,7 +372,7 @@
new_index = PersistentMapping() # new_index defines the relation
# between keys and ids of cells
- if getattr(self, 'index', None) is None:
+ if getattr(aq_base(self), 'index', None) is None:
self.index = PersistentMapping()
# Return if previous range is the same
@@ -473,7 +473,7 @@
"""
Returns the cell range as a list of index ids
"""
- if not hasattr(self, 'index'):
+ if not hasattr(aq_base(self), 'index'):
return []
cell_range = self.index.get(base_id, None)
if cell_range is None: return None
@@ -490,7 +490,7 @@
"""
This method creates a new cell
"""
- if not hasattr(self, 'index'):
+ if not hasattr(aq_base(self), 'index'):
return None
base_id= kwd.get('base_id', "cell")
cell_id = base_id
@@ -534,7 +534,7 @@
"""
Returns a list of possible keys as tuples
"""
- if not hasattr(self, 'index'):
+ if not hasattr(aq_base(self), 'index'):
return ()
if not self.index.has_key(base_id):
return ()
@@ -578,7 +578,7 @@
"""
Returns a list of possible ids as tuples
"""
- if not hasattr(self, 'index'):
+ if not hasattr(aq_base(self), 'index'):
return ()
if not self.index.has_key(base_id):
return ()
@@ -626,7 +626,7 @@
"""
Return possible base_id values
"""
- if not hasattr(self, 'index'):
+ if not hasattr(aq_base(self), 'index'):
return ()
return self.index.keys()
@@ -660,7 +660,7 @@
to_delete = []
errors = []
# We make sure first that there is an index
- if not hasattr(self, 'index'):
+ if not hasattr(aq_base(self), 'index'):
self.index = PersistentMapping()
# We will check each cell of the matrix the matrix
for obj in self.objectValues():
More information about the Erp5-report
mailing list