[Django] #35552: [Django Admin] Harmonizing obj=None parameter across multiple function

3 views
Skip to first unread message

Django

unread,
Jun 23, 2024, 10:11:21 AM6/23/24
to django-...@googlegroups.com
#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.

Django

unread,
Jun 24, 2024, 3:46:49 AM6/24/24
to django-...@googlegroups.com
#35552: [Django Admin] Harmonizing obj=None parameter across multiple function
-------------------------------+--------------------------------------
Reporter: Sven R. Kunze | Owner: nobody
Type: New feature | Status: closed
Component: contrib.admin | Version: dev
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: 0
-------------------------------+--------------------------------------
Changes (by Sarah Boyce):

* resolution: => wontfix
* status: new => closed

Comment:

Hi Sven,
The best place to discuss new features is the Django
[https://forum.djangoproject.com/c/internals/5 forum] so I recommend you
take this there to get feedback from the community.
I would also say that having a simple/small example of how you've "worked
around an issue of Django Admin" would help with this discussion. You may
find there are other ways to approach the problem 👍
--
Ticket URL: <https://code.djangoproject.com/ticket/35552#comment:1>
Reply all
Reply to author
Forward
0 new messages