#31775: An option to enforce raw_id_fields in Admin site for all relation
fields by
default
-----------------------------------------+--------------------------
Reporter: DataGreed | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: 3.0
Severity: Normal | Keywords: proposal
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 1 |
-----------------------------------------+--------------------------
Context:
Currently Django Admin renders a select element (dropdown list) of all
related foreign objects on django edit page.
Most of the time in the majority of application this causes major
slowdowns and timeouts resulting in bad user experience.
To override this behaviour you have to specify `ModelAdmin.raw_id_fields`
manually so the all of the foreign objects won't be fetched and page will
be loaded quickly. Since majority of applications only benefit from using
raw_id_fields, developers need to write boilerplate code for every
ModelAdmin with related keys.
Since just making raw id field widgets a default option may be a backward-
incompatible change that may affect all of the users, I propose to add an
setting that changes the default behaviour of this widget in admin site
e.g. `ADMIN_RAW_ID_FIELDS` which is set to `False` by default. Setting
this option to `True` will render all foreign keys as `raw_id_fields` by
default saving a lot of time on writing boilerplate code on every
migration involving Models with foreign keys that are rendered in Admin
site.
--
Ticket URL: <https://code.djangoproject.com/ticket/31775>
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/052.ba9e98e72aa956819a9c8faa81501a0d%40djangoproject.com.