[web2py] Re: validator for self-join

2011-06-01 Thread Anthony
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

[web2py] Re: validator for self-join

2011-05-31 Thread Dave
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

[web2py] Re: validator for self-join

2011-05-06 Thread pbreit
I think this might be what you want: crud.settings.create_onvalidation.mytablename.append(lambda form:) http://web2py.com/book/default/chapter/07#Settings

[web2py] Re: validator for self-join

2011-05-06 Thread Dave
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

[web2py] Re: validator for self-join

2011-05-05 Thread Massimo Di Pierro
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