Massimo,
So, even though form.vars.shapecolor=str(request.vars.shapename)+str
(request.vars.colorname) comes first in the following code:
def index():
from gluon.sqlhtml import form_factory
form=SQLFORM(db.shapecolor,fields=['shapename','colorname'])
form.vars.shapecolor=str(request.vars.shapename)+str
(request.vars.colorname)
if form.accepts(request.vars,session):
response.flash='form accepted'
elif form.errors:
response.flash='form has errors (a shape with this color
already exists)'
else:
response.flash='please fill the form'
return dict(form=form)
... the assignment is done after validation. I thought that
form.accepts(request.vars,session) would take care of validating all
three variables. I there another way to validate shapecolor?
Best regards,
Annet.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---