Ticket #11848: queryset_changelist.patch
File queryset_changelist.patch, 1.6 KB (added by , 15 years ago) |
---|
-
django/contrib/admin/options.py
307 307 def queryset(self, request): 308 308 """ 309 309 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. 311 311 """ 312 312 qs = self.model._default_manager.get_query_set() 313 313 # TODO: this should be handled by some parameter to the ChangeList. … … 316 316 qs = qs.order_by(*ordering) 317 317 return qs 318 318 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 319 325 def get_fieldsets(self, request, obj=None): 320 326 "Hook for specifying fieldsets for the add form." 321 327 if self.declared_fieldsets: -
django/contrib/admin/views/main.py
36 36 self.model = model 37 37 self.opts = model._meta 38 38 self.lookup_opts = self.opts 39 self.root_query_set = model_admin.queryset (request)39 self.root_query_set = model_admin.queryset_changelist(request) 40 40 self.list_display = list_display 41 41 self.list_display_links = list_display_links 42 42 self.list_filter = list_filter