[web2py] Re: How to organize the model for a chat application?

2014-06-03 Thread Rufus
If you don't want to create group authentication,  and playing with a 
single registration view different types of users. I wonder if you could 
have the users log into to a completely different app, if all it was for 
was for the chat.  It is possible to share databases between web2py 
applications AFAIK,  and if all chat traffic went through the common 
database, you might be good to go.  (or you could have some kind of chat 
traffic daemon in your system at a dedicated socket port that they pass 
chat messages through)

Or do the users and employees use other functions in the app as well?


-- 
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.


[web2py] Re: How to organize the model for a chat application?

2014-06-02 Thread 黄祥
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.


[web2py] Re: How to organize the model for a chat application?

2014-06-02 Thread Shubham Sinha
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.