Thanks for your help!
I Solved my problem doing this:
def processando(form):
query = db.inscritos.Oficina =='form.vars.Oficina'
if query >=1:
form.errors.Oficina = "Oficina esgotada"
else:
pass
def inscrever():
form = SQLFORM(db.inscritos)
if
i think you can use the query (count() ) and check condition according to
your need (if query >= value), if condition meet, redirect to another page
redirect(URL(redirect) ), if not insert the data (db.table.insert() ).
best regards,
stifan
--
Resources:
- http://web2py.com
-
2 matches
Mail list logo