#33321: Django admin doesn't render "add another / modify" icons next to
ForeignKey
fields that are declared in the ModelForm
-------------------------------+--------------------------------------
Reporter: James Pic | Owner: nobody
Type: Bug | Status: closed
Component: contrib.admin | Version: 3.2
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------+--------------------------------------
Comment (by James Pic):
Hello Carlton!
> Basically, ModelForm will only generate fields that are missing from
the form, or in other words, fields that weren’t defined declaratively.
Actually my report shows it's generating all fields and then overriding
them with the declared fields ... Not sure if this distinction is
important enough to be reflected in the documentation though.
It's fine for me though, in our apps we don't advertise to declare
formfields anymore, but rather to [https://yourlabs.io/oss/djhacker monkey
patch Django formfield()] method which actually lets Django think it's
generating the foreign key fields and the decorated it with
RelatedFieldWidgetWrapper, which has also [https://github.com/jonashaag
/django-addanother been copy/pasted into an external app] so it could be
reusable outside the admin, by me.
The most proper solution IMHO is to extract RelatedFieldWidgetWrapper
outside from django.contrib.admin and put in in django.forms but that's
not going to happen neither.
--
Ticket URL: <https://code.djangoproject.com/ticket/33321#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/062.a01468cba5976d3dc08c2977b1b9029b%40djangoproject.com.