#35552: [Django Admin] Harmonizing obj=None parameter across multiple function
-----------------------------------------+------------------------
Reporter: Sven R. Kunze | Owner: nobody
Type: New feature | 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 |
-----------------------------------------+------------------------
Searching the issue tracker didn't reveal anything useful. Please point me
at the right issue if this topic has already been discussed elsewhere. :-)
During several projects, we worked around an issue of Django Admin. When
using the following methods:
- `formfield_for_dbfield`
- `formfield_for_choice_field`
- `formfield_for_foreignkey`
- `formfield_for_manytomany`
- `get_field_queryset`
- `get_autocomplete_fields`
- `get_changeform_initial_data`
the current instance is really useful for complex applications, but it is
not provided though.
Our current work-around: reparsing request.path_info and retrieving the
object once again. In addition to the code redundancy, it's an additional
performance loss.
As a solution, we propose the following:
- harmonize the `obj=None` parameter across those method like `get_fields`
or `get_readonly_fields`.
--
Ticket URL: <
https://code.djangoproject.com/ticket/35552>
Django <
https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.