Re: custom manager to control access

2012-04-04 Thread Mike Dewhirst
Anssi Thanks for that - I'll do some testing. I'm also thinking of middleware to look at the request and discover the company on the way in so I can make it available to everything which processes the request and produces a response. Cheers Mike On 4/04/2012 5:55pm, akaariai wrote: On Ap

Re: custom manager to control access

2012-04-04 Thread akaariai
On Apr 4, 3:15 am, Mike Dewhirst wrote: > I have now discarded the idea :) > > I'm not very comfortable with thread locals. I need a bullet-proof > approach which makes data from other companies invisible to members of > this company. I suppose a view decorator is the way to go but I would > have

Re: custom manager to control access

2012-04-03 Thread Mike Dewhirst
On 3/04/2012 7:00pm, Tom Evans wrote: On Tue, Apr 3, 2012 at 9:43 AM, Mike Dewhirst wrote: I'm trying to make a custom manager for a few models. The objective is to limit user access to information in the database belonging to the company of which they are a member. I think I want to say: cla

Re: custom manager to control access

2012-04-03 Thread Tom Evans
On Tue, Apr 3, 2012 at 9:43 AM, Mike Dewhirst wrote: > I'm trying to make a custom manager for a few models. The objective is to > limit user access to information in the database belonging to the company of > which they are a member. > > I think I want to say: > > class Something(models.Model): >

custom manager to control access

2012-04-03 Thread Mike Dewhirst
I'm trying to make a custom manager for a few models. The objective is to limit user access to information in the database belonging to the company of which they are a member. I think I want to say: class Something(models.Model): ... objects = MemberManager() But when I run manage.py