oops. I was wrong. not
> SQLFORM(....,onvalidation=my_check)
but
form.accepts(request.vars,session,onvalidation=my_check)
Massimo
On Mar 25, 8:56 am, mdipierro <[email protected]> wrote:
> My suggestion is use the validators for the drop box only, define
>
> def my_check(form):
> if db( (db.shapecolormonth.shapename==form.vars.shapename) &
> (db.shapecolormonth.shapecolor==form.vars.shapecolor) &
> (db.shapecolormonth.month==form.vars.month) ).count():
> form.errors.month='sorry, shape+color+month combo have to be
> unique'
> return
>
> then in SQLFORM set
>
> SQLFORM(....,onvalidation=my_check)
>
> This is not the only solution. You could do everything with
> validators, but this solution is simpler.
>
> Massimo
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---