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.
Let me know how you solve it.
Gabriel
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.
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/qlf_LOpWN60/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@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.
-- Regards, Richard Cooke