Hi Salvatore,

in your admin.py you can redefine your get_queryset and do something like 
this:


class FooAdmin(admin.ModelAdmin):
 
    def get_queryset(self, request):
        if not request.user.is_superuser:
            return 
super(FooAdmin,self).get_queryset(request).filter(user=request.user) # here you 
can add any filter you want
        return super(FooAdmin, self).get_queryset(request)




The if is not necessary, it is just to show you that you have the user 
object into the request. 



On Sunday, September 21, 2014 8:33:20 AM UTC-3, Salvatore DI DIO wrote:
>
> Thank you Collin,
>
> In fact I have not really access to the list.
> II would like to flter a list wich is already rendered
> as a listbox widget (fiedset.html)
>
>
>
> Le samedi 20 septembre 2014 01:33:42 UTC+2, Collin Anderson a écrit :
>>
>> if nothing else:
>>
>> {% for item in list %}{% if item.user = user %}
>>
>> {% endif %}{% endfor %}
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f55b13d6-ee50-48f2-b6ac-d0a80a196617%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to