To enter a value of None, this might work:

default=lambda: None

Anthony

On Monday, July 23, 2012 5:04:44 PM UTC-4, Anthony wrote:
>
> default=None means that no default is specified, not that a default value 
> of None will be inserted.
>
> Anthony
>
> On Monday, July 23, 2012 5:02:33 PM UTC-4, Mark Li wrote:
>>
>> I have a table defined in the following manner:
>>
>> db.define_table('songinfo',
>> Field('songtitle'),
>> Field('artist'))
>>
>> When I add an empty entry, or upload a CSV with empty values, I can only 
>> access those values with a database call like
>>
>> songs = db(db.songinfo.artist=="").select()
>>
>> as opposed to db(db.songinfo.artist==None).select()
>>
>>
>> The web2py book states that fields default=None, but I'm getting an empty 
>> string. Is there an appropriate way to have None instead of an empty string 
>> in the database?
>>
>>
>>

-- 



Reply via email to