On Friday, May 6, 2011 8:56:12 AM UTC-7, pbreit wrote:
>
> I think this might be what you want:
>
> crud.settings.create_onvalidation.mytablename.append(lambda form:)
>
> http://web2py.com/book/default/chapter/07#Settings
>
In the case of crud.update, it would be crud.settings.update_onvali
Thanks, that did it!
On May 6, 9:56 am, pbreit wrote:
> I think this might be what you want:
>
> crud.settings.create_onvalidation.mytablename.append(lambda form:)
>
> http://web2py.com/book/default/chapter/07#Settings
I think this might be what you want:
crud.settings.create_onvalidation.mytablename.append(lambda form:)
http://web2py.com/book/default/chapter/07#Settings
I'm having trouble getting a custom validator to work with the crud
form. Is the is the correct implementation?
def f(form):
#if form.vars.id == form.vars.myfield:
form.errors.myfield = 'cannot be same as id'
...
form = crud.update(db.mytable,myrecord,onvalidation=f)
...
The form
You will need your own. It may be easier to use the onvalidate
attribute of the crud.update/crud.create forms
On May 5, 8:29 am, Dave wrote:
> I'm using a self join on one of my data tables, and need a validator
> that makes sure a record isn't joined to itself. I also need to
> combine it with
5 matches
Mail list logo