Re: Custom change_form.html

2014-09-21 Thread Salvatore DI DIO
Thanks Alex, This indeed allow me to filter the admin page which lists the albums. But, the problem I have, is, when I want to add an image. The 'add' display a listbox containing all the albums the image can be attached to And I want to filter the content of this listbox, showing only the albu

Re: Custom change_form.html

2014-09-21 Thread Alex Chiaranda
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.use

Re: Custom change_form.html

2014-09-21 Thread Salvatore DI DIO
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 %

Re: Custom change_form.html

2014-09-19 Thread Collin Anderson
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.

Custom change_form.html

2014-09-19 Thread Salvatore DI DIO
Hello, *To follow my preceding question, on customize admin view, (*Helton Alves gave me a nice response). I am wondering how to filter a list in change_form.html admin form, according to a partuculiar user ? Thank you for your help Regards -- You received this message because you are s