Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- db = DAL('sqlite://storage.sqlite')
- from gluon.tools import *
- auth = Auth(db)
- auth.define_tables()
- crud = Crud(db)
- education = ['Doctorate','Masters','Undergraduate', 'High School', 'Other']
- languages = ['English', 'French', 'Other']
- services = ['Immigration Documents', 'Get House', 'Find a Job']
- db.define_table('service',
- Field('type'), Field('active', 'boolean'),
- Field('content', 'text'), Field('date_service', 'date'))
- db.define_table('client',
- Field('first', requires=IS_NOT_EMPTY()), Field('last', requires=IS_NOT_EMPTY()), Field('middle', label='MI'),
- Field('country'),
- Field('date_client', 'date', label='Created On'), Field('address', 'text'),
- Field('city',), Field('province'),
- Field('education'), Field('languages'),
- Field('services', db.service),
- format='%(last)s, %(first)s')
- db.client.education.requires=IS_IN_SET(education)
- db.client.languages.requires=IS_IN_SET(languages)
- db.service.type.requires=IS_IN_SET(services)
- db.client.widget = SQLFORM.widgets.autocomplete(
- request, db.client.first, limitby=(0,10), min_length=2)
Advertisement
Add Comment
Please, Sign In to add comment