I\'ve created a custom Manager for a Django model which returns a QuerySet holding a subset of objects.all(). I need this to be the model\'s default Manager, since I am also
You can choose the manager by overriding the queryset method in your ModelAdmin subclass.
def get_queryset(self, request):
# use our manager, rather than the default one
qs = self.model.objects.get_queryset()
# we need this from the superclass method
ordering = self.ordering or () # otherwise we might try to *None, which is bad ;)
if ordering:
qs = qs.order_by(*ordering)
return qs