Author: btami
Date: 2008-03-17 14:20:13 -0500 (Mon, 17 Mar 2008)
New Revision: 9857
Modified:
trunk/gnue-reports/src/base/GRDataMapper.py
trunk/gnue-reports/src/base/layout/GRSumm.py
Log:
fixed None default handling of summ elements
Modified: trunk/gnue-reports/src/base/GRDataMapper.py
===================================================================
--- trunk/gnue-reports/src/base/GRDataMapper.py 2008-03-17 11:04:56 UTC (rev 9856)
+++ trunk/gnue-reports/src/base/GRDataMapper.py 2008-03-17 19:20:13 UTC (rev 9857)
@@ -291,7 +291,7 @@
def addSummaryToSection(self, function, section, field, formula):
self.sectionMap[section].addSummary(function, (field, formula))
- if field != 'none':
+ if not field is None:
self.sources.getDataSource(self.sectionMap[section].source) \
.referenceField(field)
@@ -393,9 +393,9 @@
field, formula = key
for function in _summFunctions:
if s.summaries[key].has_key(function):
- if field != 'none':
+ if not field is None:
s._summMap[function](key, recordset.getField(field))
- elif formula != 'none' and s.formulas.has_key(formula):
+ elif (not formula is None) and s.formulas.has_key(formula):
s._summMap[function](key, s.formulas[formula])
# What will the next section be?
Modified: trunk/gnue-reports/src/base/layout/GRSumm.py
===================================================================
--- trunk/gnue-reports/src/base/layout/GRSumm.py 2008-03-17 11:04:56 UTC (rev 9856)
+++ trunk/gnue-reports/src/base/layout/GRSumm.py 2008-03-17 19:20:13 UTC (rev 9857)
@@ -51,8 +51,14 @@
else:
self._section = None
- self._field = string.lower(self.field)
- self._formula = string.lower(self.formula)
+ if hasattr(self, 'field'):
+ self._field = string.lower(self.field)
+ else:
+ self._field = None
+ if hasattr(self, 'formula'):
+ self._formula = string.lower(self.formula)
+ else:
+ self._formula = None
return GRLayoutElement._buildObject(self)
def process(self, dest, mapper, isfirst, islast, firstSection, nextSection):
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.