Alright the only problem is that since I am not using web2py's built in user authentication for the employees wouldn't I need to write separate views for logout,login etc? I want the employee registration to be exactly like the user but with different fields On Monday, June 2, 2014 5:58:24 PM UTC-7, 黄祥 wrote: > > My question is, to integrate it with a chat application to work for the > users and employees would I need to have the users and employees stored in > separate tables? Should I create a separate table for the employees? > > It depends on how you designed your model, in the past i've walking in the > circle for auth like chicken and egg, but as time goes by, i think > simplicity is the best. let the auth table untouch, and create the employee > table. you maybe asked the auth table have the field that i need, the > answer is on the employee table. > e.g. > auth table untouch > auth.define_tables(username = True, signature = True) > > employee table > db.define_table('employee', > Field('is_auth', 'boolean'), > Field('auth_user', 'reference auth_user'), > Field('salutation'), > Field('first_name'), > Field('last_name'), > Field('gender'), > Field('address', 'text'), > Field('zip_code'), > Field('city'), > Field('country'), > Field('phone', 'list:string'), > Field('email', 'list:string'), > Field('ym', 'list:string'), > Field('bank', 'reference bank'), > Field('account_no'), > Field('branch', 'reference branch'), > Field('notes', 'text'), > auth.signature, > format = '%(first_name)s %(last_name)s') > > so if you want to add custom auth table, like phone, branch, etc, it all > covered in employee table. when your system growth, perhaps you want to > know how many employee in the company, or have payroll system too, but not > all the employee gain the access (auth) to the system (e.g. office boy) > > best regards, > stifan >
-- 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+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.