Hi, I'm new in web2py and I'm bulding apps for students registrations on
school events.
Exists better method for setting ALL default values in fields and hide them
ALL in SQLFORM? I do not make it in table definition as I need table for
other form.
Thanks
My definition:
def view_event():
event = db.s_events[request.args(0)] or redirect(URL(r=request, f=
'index'))
# Hide fields in SQLFORM and set default values
db.registrations.s_event.writable = False
db.registrations.s_event.readable = False
db.registrations.s_event.default = request.args(0)
db.registrations.registered_user.writable = False
db.registrations.registered_user.readable = False
db.registrations.registered_user.default = auth.user.id
db.registrations.registered_on.writable = False
db.registrations.registered_on.readable = False
form = SQLFORM(db.registrations, submit_button='sign').process()
return dict(event=event, form=form)
--
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.