Ticket #11848: queryset_changelist.patch

File queryset_changelist.patch, 1.6 KB (added by Igor Sobreira, 15 years ago)
  • django/contrib/admin/options.py

     
    307307    def queryset(self, request):
    308308        """
    309309        Returns a QuerySet of all model instances that can be edited by the
    310         admin site. This is used by changelist_view.
     310        admin site.
    311311        """
    312312        qs = self.model._default_manager.get_query_set()
    313313        # TODO: this should be handled by some parameter to the ChangeList.
     
    316316            qs = qs.order_by(*ordering)
    317317        return qs
    318318
     319    def queryset_changelist(self, request):
     320        """
     321        Returns a QuerySet of all models instances that will be listed by changelist_view.
     322        """
     323        return self.queryset(request)
     324
    319325    def get_fieldsets(self, request, obj=None):
    320326        "Hook for specifying fieldsets for the add form."
    321327        if self.declared_fieldsets:
  • django/contrib/admin/views/main.py

     
    3636        self.model = model
    3737        self.opts = model._meta
    3838        self.lookup_opts = self.opts
    39         self.root_query_set = model_admin.queryset(request)
     39        self.root_query_set = model_admin.queryset_changelist(request)
    4040        self.list_display = list_display
    4141        self.list_display_links = list_display_links
    4242        self.list_filter = list_filter
Back to Top