Re: 2.0.6: "Required=True" not enforced by DAL?

20 views
Skip to first unread message

Massimo Di Pierro

unread,
Sep 5, 2012, 5:23:37 PM9/5/12
to web...@googlegroups.com
required=True means that a value must be provided. For a string merk='' is a value.


On Wednesday, 5 September 2012 12:27:05 UTC-5, mjm wrote:
I have created simple table:

db.define_table('hoortoestel', 
# algemeen
Field('merk', type='string', required=True, ), 
Field('type', type='string', required=True, ),
...

When trying to enter a new record in appadmin I noticed that when not entering anything in either field, the new record data is accepted and entered into the (SQLlite) database. I think that's a bug. 
If I change the required constraint to notnull=True, the empty record is indeed rejected, as expected. 


Reply all
Reply to author
Forward
0 new messages