Validators during db.insert

1 view
Skip to first unread message

Frederik Wagner

unread,
Nov 9, 2009, 8:06:35 AM11/9/09
to web...@googlegroups.com
Hi .*,

is there a way of making web2py run the validators configured in the
model on a dataset inserted via a direct db.table.insert statement? It
looks like I'm able to insert any kind of data, it's validated...

Thanks and Bye,
Frederik

fnerdwq

unread,
Nov 9, 2009, 8:48:13 AM11/9/09
to web2py-users

mdipierro

unread,
Nov 9, 2009, 10:42:25 AM11/9/09
to web2py-users
Validators apply to forms only not database insert. This is for speed
but also because the workflow would be unclear: how would error be
reported? As exceptions?

I guess you can define your own insert function that validates before
insert and throws an exception on failed validation.

Massimo
Reply all
Reply to author
Forward
0 new messages