[Django] #28369: Django Admin "Save and add another" NoReverseMatch with custom urls

49 views
Skip to first unread message

Django

unread,
Jul 6, 2017, 3:00:08 PM7/6/17
to django-...@googlegroups.com
#28369: Django Admin "Save and add another" NoReverseMatch with custom urls
-----------------------------------------+------------------------
Reporter: steve yeago | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
-----------------------------------------+------------------------
Django admin could provide a hook for cases where there are additional
parameters necessary to build an add or change url. Current hook
"response_change" makes many hard-coded presumptions about how to reverse
and add or change url. While its a nice hook to have for some cases, its
so verbose that overriding it for this purpose is very hard.

--
Ticket URL: <https://code.djangoproject.com/ticket/28369>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jul 6, 2017, 3:20:33 PM7/6/17
to django-...@googlegroups.com
#28369: Django Admin "Save and add another" NoReverseMatch with custom urls
-------------------------------+--------------------------------------

Reporter: steve yeago | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by steve yeago):

* has_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/28369#comment:1>

Django

unread,
Jul 6, 2017, 5:07:10 PM7/6/17
to django-...@googlegroups.com
#28369: Provide ModelAdmin hooks for reversing URLs
-------------------------------+--------------------------------------

Reporter: steve yeago | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Tim Graham):

* needs_docs: 0 => 1
* easy: 1 => 0
* needs_tests: 0 => 1


Comment:

I [https://groups.google.com/d/topic/django-
developers/479TIjEk1_g/discussion lamented on django-developers] about the
never ending number of `ModelAdmin` hooks. I fear we'll end up with an
unmaintainable mess if we make every little thing customizable. Those
methods would also need to be documented and tested. Perhaps you could
describe your use case in more detail to help justify the additional
complexity.

--
Ticket URL: <https://code.djangoproject.com/ticket/28369#comment:2>

Django

unread,
Jul 6, 2017, 5:38:32 PM7/6/17
to django-...@googlegroups.com
#28369: Provide ModelAdmin hooks for reversing URLs
-------------------------------+--------------------------------------
Reporter: steve yeago | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed

Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------

Comment (by steve yeago):

Well in some ways I think the patch creates some consistency given that
there is already a hook for the "view on site" url in the admin. Grepping
around, there could be some savings of lines get_*_url in the tests where
basically the same hooks already exists.

Example: http://dpaste.com/1JFCGQG

The current implementation presumes that a modeladmin is registered under
a namespace with no other args or kwargs, but that may not be the case if
someone has included additional url args in get_urls(). Almost everything
about the admin works fine out of the box in this situation aside from the
somewhat superficial problem of where the user is redirect post-save
because, the urls that are being reversed deep in response_change (and
subsequently response_post_save_change) are hard-coded.

--
Ticket URL: <https://code.djangoproject.com/ticket/28369#comment:3>

Django

unread,
Jul 10, 2017, 12:16:43 PM7/10/17
to django-...@googlegroups.com
#28369: Provide ModelAdmin hooks for reversing URLs
-------------------------------+------------------------------------
Reporter: steve yeago | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by Tim Graham):

* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/28369#comment:4>

Django

unread,
Aug 2, 2017, 11:13:42 AM8/2/17
to django-...@googlegroups.com
#28369: Provide ModelAdmin hooks for reversing URLs
-------------------------------+------------------------------------
Reporter: steve yeago | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------

Comment (by steve yeago):

my patch is ready

--
Ticket URL: <https://code.djangoproject.com/ticket/28369#comment:5>

Django

unread,
Aug 2, 2017, 2:25:24 PM8/2/17
to django-...@googlegroups.com
#28369: Provide ModelAdmin hooks for reversing URLs
-------------------------------+------------------------------------
Reporter: steve yeago | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------

Comment (by Tim Graham):

The patch still lacks documentation of the new `ModelAdmin` methods. You
should update the ticket's flags as indicated in the "According to the
ticket's flags, the next step(s) to move this issue forward are:" box
below the ticket description.

--
Ticket URL: <https://code.djangoproject.com/ticket/28369#comment:6>

Django

unread,
Dec 27, 2018, 5:48:04 PM12/27/18
to django-...@googlegroups.com
#28369: Provide ModelAdmin hooks for reversing URLs
-------------------------------+------------------------------------
Reporter: steve yeago | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by Christophe Baldy):

* cc: Christophe Baldy (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/28369#comment:7>

Django

unread,
Dec 8, 2019, 11:59:13 PM12/8/19
to django-...@googlegroups.com
#28369: Provide ModelAdmin hooks for reversing URLs
-------------------------------+-----------------------------------------
Reporter: steve yeago | Owner: Abhishek Bera
Type: New feature | Status: assigned
Component: contrib.admin | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+-----------------------------------------
Changes (by Abhishek Bera):

* owner: nobody => Abhishek Bera
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/28369#comment:8>

Django

unread,
Mar 18, 2024, 2:53:42 AM3/18/24
to django-...@googlegroups.com
#28369: Provide ModelAdmin hooks for reversing URLs
-------------------------------+------------------------------------
Reporter: steve yeago | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by Ülgen Sarıkavak):

* cc: Ülgen Sarıkavak (added)

Django

unread,
Feb 2, 2025, 12:19:12 AM2/2/25
to django-...@googlegroups.com
#28369: Provide ModelAdmin hooks for reversing URLs
-------------------------------+------------------------------------
Reporter: steve yeago | Owner: Antoliny
Type: New feature | Status: assigned
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by Antoliny):

* owner: nobody => Antoliny
* status: new => assigned

--
Ticket URL: <https://code.djangoproject.com/ticket/28369#comment:9>

Django

unread,
Mar 16, 2025, 3:56:47 AM3/16/25
to django-...@googlegroups.com
#28369: Provide ModelAdmin hooks for reversing URLs
-------------------------------+------------------------------------
Reporter: steve yeago | Owner: (none)
Type: New feature | Status: new
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by Antoliny):

* cc: Antoliny (added)
* owner: Antoliny => (none)
* status: assigned => new

--
Ticket URL: <https://code.djangoproject.com/ticket/28369#comment:10>
Reply all
Reply to author
Forward
0 new messages