Kate Legere wrote:
Module None, line 45, in copy_of_stats_output_branch
<PythonScript at copy_of_stats_output_branch>
Line 45
for j in self.sql.sqlGetStatDetailsSum(date1=i.date, branch1=i.branch,
category1=i.category, timeCheck1=k):
if str(j.sum_renewals)== 'None':
line 45 --> j.sum_renewals = 0
elif str(j.sum_registrations)== 'None':
j.sum_renewals = 0
elif str(j.sum_hours)== 'None':
j.sum_renewals = 0
elif str(j.sum_reference)== 'None':
j.sum_renewals = 0
When I have values returned by the sql call it works fine but as soon as I
get to a field that has a 0 in it then I get an error...
As far as I can tell I'm doing the assignment correctly ... what's wrong
here?
Kate
Kate,
But the code looks weird ... Id test something like
if not j.sum_renewals:
j.sum_renewals = 0
David H
_______________________________________________
Zope maillist - Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )