﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
9750	Manager Documentation and Admin interface	mm	nobody	"In http://docs.djangoproject.com/en/dev/topics/db/managers/ it says:

{{{
If you use custom Manager objects, take note that the first Manager Django encounters
(in the order in which they're defined in the model) has a special status. Django
interprets this first Manager defined in a class as the ""default"" Manager, and several
parts of Django (though not the admin application) will use that Manager exclusively for
that model. As a result, it's often a good idea to be careful in your choice of default
manager, in order to avoid a situation where overriding of get_query_set() results in an
inability to retrieve objects you'd like to work with.
}}}

I found this to be wrong. The admin interface will only list the objects that are in the queryset that the default manager returns

This will only return objects with a status of `finished=True` in the admin, it's not even possible to access them directly by URL (default is to create objects that won't show)

Note: code written from scratch but you should get the idea, mind the order of appearance of the managers...
{{{
from django.db import models
from django.contrib import admin

class FinishedManager(models.Manager):
    def get_query_set(self):
        return super(FinishedManager, self).get_query_set().filter(finished=True)

class Todo(models.Model):
    title = models.CharField(max_length=250)
    finished = models.BooleanField(default=False)

    finished_objects = FinishedManager()
    objects = models.Manager()


class TodoAdmin(admin.ModelAdmin):
    model = Todo

admin.site.register(Todo, TodoAdmin)
}}}

while having a `Todo`-class like below will return all objects:

{{{
class Todo(models.Model):
    title = models.CharField(max_length=250)
    finished = models.BooleanField(default=False)

    objects = models.Manager()
    finished_objects = FinishedManager()
}}}"		closed	Documentation	1.0		wontfix		martin@…	Unreviewed	0	0	0	0	0	0
