Are you certain that the django admin interface is actually using
LiveEntryManager?  I just tested this out (using trunk):

class BadManager(models.Manager):
    def all(self): return self.get_query_set().filter(slug='')
    def filter(self, *args, **kwargs): return super(BadManager,
self).filter(slug='')

and inside my model I have:

class Post(models.Model):
    ... (column declarations here) ...
    live = BadManager()
    objects = models.Manager()

When I try out my admin interface, it's properly returning Posts.
When I call Post._default_manager from a shell it returns an instance
of "BadManager"

If you're still seeing this problem with your code, maybe check for:

1. Are your "class Admin" values setup properly for this object?
list_display? list_filter?
2. Have you imported something called "models" into your models file
that isn't django.db.models, which is hijacking your "models.Manager"
declaration?

Some additional things to consider:
Any reason for having "live" as your default manager? Switching the
order of "live" and "objects" will make "objects" the default_manager.
Also, in practice I'll usually make a manager that adds some
additional features to the models.Manager and just use this manager as
my only manager. For example if I have Posts, where I tend to only
retrieve published ones, I might add a function called "published"
that filters down to published posts, which lets me do this:
"Post.objects.published()".  This way all the standard functions of
Post.objects are kept intact, but I have some additional features
available.

On Sep 8, 1:20 pm, Alasdair <[email protected]> wrote:
> I've defined a custom manager
>
> class Entry(models.Model):
>     [...]
>     live = LiveEntryManager()
>     objects = models.Manager()
>
> so that when I use _default_manager.all() it uses the LiveEntryManager
> ().
>
> However, the django admin is now also using LiveEntryManager. How can
> I get the admin to use models.Manager, while keeping LiveEntryManager
> as the default for everything else?
>
> (I'm using django 1.1)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
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