On Mon, Feb 9, 2009 at 4:17 PM, Julien Phalip <jpha...@gmail.com> wrote:

> Hello again,
>
> I finally fixed it with the following nasty hack:
>
> class Entry(models.Model):
>        ... some fields ...
>
>         objects = models.Manager() # Nasty hack
>        published = PublishedEntryManager()
>
> It seems like the 'change_state' view uses the custom manager instead
> of the default one. Explicitly setting 'objects' make it work. If you
> can think of a more elegant fix, please let me know ;)
>

? The first manager declared IS the default manager, so if the first and
only manager you had declared was the restrictive one, that was the default,
so that is what was used.  Declaring an unrestricted manager first, as you
have done, is the documented way to have an unrestricted default manager
plus one or more custom more restrictive managers.

Karen

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

Reply via email to