Hi, I am newbie to web2py. I am working on a project where multiple people will have to get different type of authentication, (e.g. teacher and student have different level of access to the system). Now the problem is that I can not create different instances of Auth class, e.g.
autht = Auth(globals(), db) autht.settings.table_user = db.define_table('teacher', db.Field('first_name'), db.Field('middlename'), db.Field('last_name'), db.Field('specialization'), db.Field('highestdegre'), db.Field('housenum'), db.Field('streetnum'), db.Field('area'), db.Field('city'), db.Field('country'), db.Field('phone'), db.Field('email', requires = [IS_EMAIL(), IS_NOT_IN_DB(db,'teacher.email')]), db.Field('username'), db.Field('password', 'password', readable=False, requires=CRYPT ()), db.Field('registration_key', length = 128, writable = False, readable = False, default = ''), db.Field('createdon', 'date' , default = now), #db.Field('controller', db.controller) ) autht.define_tables() work seamlessly well but when I create another one, no matter which one is defined first it throws error, e.g I created following: authc = Auth(globals(), db) authc.settings.table_user = db.define_table('controller', db.Field('first_name'), db.Field('middlename'), db.Field('last_name'), db.Field('phone'), db.Field('email', requires = [IS_EMAIL(), IS_NOT_IN_DB(db,'teacher.email')]), db.Field('username'), db.Field('password', 'password', readable=False, requires=CRYPT ()), db.Field('registration_key', length = 128, writable = False, readable = False, default = ''), db.Field('createdon', 'date' , default = now) ) authc.define_tables() this gives me following error: ProgrammingError: (1146, "Table 'web2py.controller' doesn't exist") does this error mean that web2py didnt find controller table in db, isnt it supposed to make it itself? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---