Saturday, February 19, 2011

Re: Filtering the filters in Django Admin

I dont think there's a trivial way to do this. You might end up
hacking into the django code itself.

--
Gladys
http://bixly.com


On Feb 20, 5:58 am, SimpleDimple <farhandevelo...@gmail.com> wrote:
> Here is my code for a school projecthttp://dpaste.com/434311/
>
> The code works fine, on studentadmin list page, I get filter for
> classes
> which is good but as you can see my project is multi-tenant so in
> filter
> area I want to show only the classes for the school the current user
> is
> logged in (tracked thru sessions) but right now I can see list of all
> classes from all schools
>
> so I want to replace this line
>     list_filter   = ['xclass']
>
> with something like
>     list_filter   =
> Class.objects.filter(school=request.session['school_id'])
>
> how can I do it ?

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate