Re: [web2py] Re: simplest way to get rid of "None" strings

2014-01-19 Thread Stef Mientki
thanks, I'll santinize the database onec a while. cheers, Stef On 19-01-14 13:45, Niphlod wrote: or, if indeed you want all strings fields with NULL values (backends side) or "None" (python side) to map to an empty string '', use none_value = None for f in db.table.fields: if db.table[f

Re: [web2py] Re: simplest way to get rid of "None" strings

2014-01-19 Thread Niphlod
or, if indeed you want all strings fields with NULL values (backends side) or "None" (python side) to map to an empty string '', use none_value = None for f in db.table.fields: if db.table[f].type == 'string': db(db.table[f] == None).update(f='') On Sunday, January 19, 2014 3:21:49

Re: [web2py] Re: simplest way to get rid of "None" strings

2014-01-18 Thread Anthony
> > but I mean the field is empty / Null / None (type), > which is translated by web2py into a string value 'None'. > None is translated into a string value as 'None' by Python, not web2py. If you want different behavior, you have to be explicit (no reason to assume the default behavior should

Re: [web2py] Re: simplest way to get rid of "None" strings

2014-01-18 Thread Stef Mientki
thanks, it's a workaround, but I mean the field is empty / Null / None (type), which is translated by web2py into a string value 'None'. cheers, Stef On 18-01-14 19:06, Niphlod wrote: if you mean the "other" app fills the fields with an actual string that holds the 'None' value (it could be v

[web2py] Re: simplest way to get rid of "None" strings

2014-01-18 Thread Niphlod
if you mean the "other" app fills the fields with an actual string that holds the 'None' value (it could be very well "foo", "bar" or "pizza") then fake_none_value = 'foo' for f in db.table.fields: db(db.table[f] == fake_none_value).update(f=None) should solve it On Saturday, January 1