tickets: 10761
This data as json
id | created | changetime | last_pulled_from_trac | stage | status | component | type | severity | version | resolution | summary | description | owner | reporter | keywords | easy | has_patch | needs_better_patch | needs_tests | needs_docs | ui_ux |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
10761 | 2009-04-07 21:12:10 | 2020-08-18 15:43:16 | 2022-03-06 03:48:08.501576 | Accepted | new | contrib.admin | New feature | Normal | dev | ModelAdmin.queryset() is missing a mechanism for specifying different querysets for changelist and change object views | `ModelAdmin.queryset()` is used both in the changelist and change object views. Suppose some fields are deferred in the returned queryset to speed up changelist rendering. As a result, the object change view has to perform additional queries for all the deferred fields to pull them in. The proposed solution is to add another parameter to `queryset()` that specifies whether a changelist or change object queryset should be returned as follows: {{{ def queryset(self, request, for_change_object_view=False): }}} | nobody | mrts | efficient-admin | 0 | 0 | 0 | 0 | 0 | 0 |