Changeset 1270


Ignore:
Timestamp:
01/08/07 14:16:43 (6 years ago)
Author:
ijm1
Message:

buildUpdateFromDict was casting strings from ccsweb into integers for
use in PostgreSql? update statements. The problem with this is that when
a floating point number gets truncated down to an integer instead of a
ValueError? being thrown and therefore any real number updated into the
database will actually be truncated.

Fixed by letting sql deal with the conversion, all we do is pass it the
string.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ccsd/trunk/crcnetd/_utils/ccsd_common.py

    r1182 r1270  
    454454            f=1 
    455455            c="" 
    456         try: 
    457             v = int(newDetails[prop]) 
    458         except ValueError: 
    459             v = newDetails[prop] 
     456        v = newDetails[prop] 
     457         
    460458        if doNull and v==-1: 
    461459            sql = "%s%s %s=NULL" % (sql, c, prop) 
Note: See TracChangeset for help on using the changeset viewer.