Actually I had tried it that way initially to no avail. Thanks to your
pointer I tried again and discovered why it hadn't worked:
http://code.djangoproject.com/changeset/4584/django

The change_list_queryset hook as been renamed to just queryset

It's working beautifully now.

I'm still sticking my admin options and hooks in models.py. Is there a
consensus for where they should go now? It would be nice to have
conventions for things like this.

On 23 Jul, 22:09, Jonathan Buchanan <[EMAIL PROTECTED]>
wrote:
> AndyB wrote:
> > Page 18 and 19 of this 
> > PDF:http://www.vanpyz.org/Djangojam/django_vancouver.pdf
>
> > give examples of some of the newhooksavailable innewforms-admin.
> > This is the only documentation I can find anywhere for this at the
> > moment.
>
> > The examples involve declaring a class called Admin. I think I might
> > be missing something obvious. Where does one do this and is there
> > anything else that I need to do? I've tried the following in models.py
> > to no avail:
>
> > class Admin:
> >     def change_list_queryset(self, request):
> >         userOrg = Organisation.objects.filter(contact=request.user.id)
> >         if (request.user.id==1):
> >             return Job.objects.all()
> >         else:
> >             return Job.objects.filter(organisation=userOrg)
>
> > The simplified version also doesn't work:
>
> > class Admin:
> >     def change_list_queryset(self, request):
> >         return Job.objects.filter(organisation=1)
>
> > so maybe the problem is sticking it in models.py?
>
> Perhaps this will be more informative:
>
> http://code.djangoproject.com/wiki/NewformsAdminBranch
>
> Jonathan.


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to