this is not the complete code:
def main():
msg = CAT()
frm = SQLFORM.factory(db.case, db.sheet, buttons=btn)
if frm.process(onvalidation=chk_1step).accepted:
cidi = db.case.insert(**db.case._filter_fields(frm.vars))
frm.vars.case_id = cidi
sidi =db.sheet.insert(**db.sheet._filter_fields(frm.vars))
#more processing of non frm fields that were generated on the
client side using jQuery that go to a 3rd or 4th table...
elif frm.errors:
msg.append(frm.errors)
request.flash = 'errors'
return dict(message=msg, form=frm)
def chk_1step(f):
v, e = f.vars, f.errors
if (v.customer_nights_spent is None):
for i in range(1,100):
# the following request.vars were created by the client jQuery
as the user added each child only as needed.
if (request.vars['child_%i' % i]):
try:
ns = int(request.vars['child_nights_spent_%i' % i])
except:
ns = None
if (ns is None):
frm.errors['child_nights_spent_%i' % i] = 'child nights
spent required'
else:
break
return f
hope that complete enough to get an idea of what i am doing. thanx
anthony. we should meet sometime and have some drinks or coffee. lucas
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.