Ok, I think I have sorted out my queryset problem, I wrote a custom
manager:

class UserBranchModelManager(models.Manager):
    def for_request(self, request):
        if settings.DO_BRANCH_FILTER:
            return super(UserBranchModelManager,
self).get_query_set().filter(branch__pk = request.userBranchID)
        return super(UserBranchModelManager, self).get_query_set()

class Amodel(models.Model):
  branch_filter = UserBranchModelManager()

def aview(request)
   queryset.= Amodel.branch_filter.for_request(request)


Thanks Shawn for directing me in the right direction. Now I just need
to override the get() method. :)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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