where do you put he query  db.auth_user.branch_adress?

I want the user to add company, not to choose from avaliable companies, but 
the data is inserted into organization table



On Tuesday, December 3, 2013 1:54:57 PM UTC+1, 黄祥 wrote:
>
> i think it will make the database table denormalization (make data 
> redundancy) if you put almost all of your organization table value to your 
> auth_user table. 
> i think just refer the organization from auth_user table is more than 
> enough, and if you want to know this user belong to which organization 
> address, city, state, etc, then you can just query it.
> please examine the example code i gave first, you will see that my 
> auth_user table is refer to table branch, which is have almost the same 
> field like your (address, city, state), but in my case i just refer only 
> one, if i want to know where is this user works in, i can query it in my 
> example : db.auth_user.branch.address.
> e.g. 
> db.define_table('company', 
> Field('name'), 
> Field('website'), 
> Field('logo', 'upload'), 
> format = '%(name)s')
>
> db.define_table('bank', 
> Field('bank'), 
> Field('ebanking'), 
> format = '%(bank)s')
>
> db.define_table('branch', 
> Field('address', 'text'), 
> Field('zip_code'), 
> Field('city'), 
> Field('country'), 
> Field('phone', 'list:string'), 
> Field('fax', 'list:string'), 
> Field('email', 'list:string'), 
> Field('bank', 'list:reference bank'), 
> Field('company', 'reference company'), 
> format = '%(address)s')
>
> 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/groups/opt_out.

Reply via email to