#33375: Admin changelist_formset does not use the Admin queryset
--------------------------------------------+------------------------
Reporter: François Freitag | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: dev
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
--------------------------------------------+------------------------
I’m implementing soft-deletion for `models.Model`s with a `BooleanField`
named `deleted`. For the entire system (except Django admin), an object
`deleted=True` no longer exist. That is implemented by setting the default
manager to an `objects` manager that ignores `deleted=True` rows.
For the admin, I’m overriding the queryset to include `deleted=True`.
When using `list_editable = ["deleted"]`, the soft-deleted objects cannot
be re-activated. The reason is that the `id` field in the
`changelist_formset` uses the `_default_manager` (`objects`).
I do not want to make `include_deleted` the default manager, as any model
field in the system would use that instead of the `objects`, unless
overridden.
IMO, the admin should be using the result of `get_queryset()` for the
changelist_formset `id` field Queryset.
Happy to attempt patching if the ticket is accepted.
--
Ticket URL: <https://code.djangoproject.com/ticket/33375>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/058.00ea2e31f4fc1773b9c45134eb77731a%40djangoproject.com.