How I would do it would be to have a special column (foreign key) in each table 
(model) called Company (company_id) and change all default managers to filter 
on company_id = logged_in_user.company_id. 

In this way you are sure tha users only see what belongs to their company. 

You would have to pass the company_id to models, probably with a middleware 
which gets it from the logged in user and saves it somewhere. 

And you also have to save the default value of company_id to each newly created 
entry in every table, probably from the same source as above. 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to