#33813: Incorrect queryset for the 'id' field in the InlineModels' forms for
django.cotrib.admin when using custom model managers
-------------------------------------+-------------------------------------
Reporter: Hristo Trendafilov | Owner: nobody
Type: Bug | Status: closed
Component: contrib.admin | Version:
Severity: Normal | Resolution: duplicate
Keywords: | Triage Stage:
admin,inlines,custom model | Unreviewed
manager |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):
* status: new => closed
* resolution: => duplicate
Comment:
This is a duplicate of #33375 — in
[https://github.com/django/django/blob/33401cba9317de2487c31ffdd1a5a51ecfbc0248/django/forms/models.py#L859-L862
BaseModelFormSet.add_fields()] we add the `id` `ModelChoiceField` using
the default manager.
You'll need to provide the
[https://docs.djangoproject.com/en/4.0/ref/contrib/admin
/#inlinemodeladmin-options inline's `form` option] to provide the base
form class declaring the `id` `ModelChoiceField` with the correct (for
your case) QuerySet.
--
Ticket URL: <https://code.djangoproject.com/ticket/33813#comment:2>
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/01070181aee3a533-2020a942-9856-4e1e-b13b-7e3fc6ddf039-000000%40eu-central-1.amazonses.com.