db.define_table('markers',
Field('first_name','string'),
Field('last_name','string'),
Field('email', 'string', requires=IS_EMAIL()),
format='%(first_name)s %(last_name)s')
db.define_table('assignments',
Field('student_first_name','string', notnull=True),
Field('student_last_name','string', notnull=True),
Field('marker','reference markers'))
def new_assignment():
db.markers._format = '%(last_name)s, %(first_name)s (%(email)s)'
form = SQLFORM(db.assignments)
if form.process().accepted:
response.flash = 'Assignment created'
redirect(URL('assignments'))
return dict(form=form)
db.assignments.marker.requires = IS_IN_DB(db, 'markers.id','%(last_name)s, %(first_name)s (%(email)s)'
)
2. Check out the .represent attribute
--
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 web2py+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/dc15ee08-5608-43b2-97fe-2c998aec5a9do%40googlegroups.com.