Hi all,

I'm working on a safe way to get users to only see there own records. I've 
been working on subclassing model.Manager and requiring a 'owner' parm for 
filter() or otherwise returning an emtpy query set .. just to failsafe my 
own view coding.

Then I figured I could get records in my view via the user.whatever_objects 
like this:

     user = User.objects.get(username=request.user)
     customer_list = user.customers.all().order_by('company_name')

But that would make two db connects. When growing in scale, could this 
eventually be a performance bottleneck?

I ask this because now I can still choose how to set things up without 
refactoring my codebase.

Thanx a lot.

Regards,

Gerard.

-- 
self.url = www.gerardjp.com

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

Reply via email to