[Django] #27243: Make reverse_dict.getlist work with fully qualified module names

5 views
Skip to first unread message

Django

unread,
Sep 19, 2016, 6:51:10 AM9/19/16
to django-...@googlegroups.com
#27243: Make reverse_dict.getlist work with fully qualified module names
-----------------------------+--------------------
Reporter: erob | Owner: nobody
Type: New feature | Status: new
Component: Core (URLs) | Version: 1.10
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 1
Easy pickings: 0 | UI/UX: 0
-----------------------------+--------------------
The function _reverse_with_prefix in django/urls/resolvers.py doesn't
handle fully qualified module names. This patch ensure that reverse()
works in this case.

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

Django

unread,
Sep 19, 2016, 6:51:31 AM9/19/16
to django-...@googlegroups.com
#27243: Make reverse_dict.getlist work with fully qualified module names
-------------------------+----------------------------

Reporter: erob | Owner: nobody
Type: New feature | Status: new
Component: Core (URLs) | Version: 1.10
Severity: Normal | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Easy pickings: 0
UI/UX: 0 |
-------------------------+----------------------------
Changes (by erob):

* Attachment "resolvers.diff" added.

Django

unread,
Sep 19, 2016, 6:53:51 AM9/19/16
to django-...@googlegroups.com
#27243: Make reverse_dict.getlist work with fully qualified module names
-----------------------------+--------------------------------------

Reporter: erob | Owner: nobody
Type: New feature | Status: new
Component: Core (URLs) | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-----------------------------+--------------------------------------
Changes (by erob):

* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0


Comment:

For discussion of this issue see: https://groups.google.com/forum/#!topic
/django-users/FVH1sA_j1tM

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

Django

unread,
Sep 19, 2016, 7:21:33 AM9/19/16
to django-...@googlegroups.com
#27243: Make reverse_dict.getlist work with fully qualified module names
-----------------------------+--------------------------------------

Reporter: erob | Owner: nobody
Type: New feature | Status: new
Component: Core (URLs) | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed

Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-----------------------------+--------------------------------------
Changes (by timgraham):

* needs_tests: 0 => 1


Comment:

Can you please summarize the discussion and explain what use case this
solves? Tests are also needed.

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

Django

unread,
Sep 19, 2016, 7:38:13 AM9/19/16
to django-...@googlegroups.com
#27243: Make reverse_dict.getlist work with fully qualified module names
-----------------------------+--------------------------------------

Reporter: erob | Owner: nobody
Type: New feature | Status: new
Component: Core (URLs) | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed

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

Comment (by erob):

I want to make Django 1.10 fully compatible with my urlpatterns
configuration. I use a custom urlresolver module (notmm.utils.urlmap) to
allow mapping url patterns to named views:
{{{
from notmm.utils.urlmap import RegexURLMap
urlpatterns = RegexURLMap()
urlpatterns.add_routes('foobar.views',
(r'^index.html$', 'index'),
)
}}}
add_routes() automatically create a fully qualified callback object to
ensure the view function is a callable. However, Django doesn't handle
fully qualified module names in reverse() without this patch.

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

Django

unread,
Sep 19, 2016, 8:03:34 AM9/19/16
to django-...@googlegroups.com
#27243: Make reverse_dict.getlist work with fully qualified module names
-----------------------------+--------------------------------------

Reporter: erob | Owner: nobody
Type: New feature | Status: new
Component: Core (URLs) | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed

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

Comment (by timgraham):

I guess you might be running into problems because Django 1.10 removed
support for string `view` arguments in `url()`
(a25d3ce007b90a0516aed54fc1c5a16510a290e4 and/or
785cc71d5b3300e2702b0b2fc7316e58ca70b563). I'm not sure whether or not we
can accommodate the use case, but as-is your patch crashes the test suite.

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

Django

unread,
Sep 20, 2016, 2:00:47 PM9/20/16
to django-...@googlegroups.com
#27243: Make reverse_dict.getlist work with fully qualified module names
-----------------------------------+--------------------------------------
Reporter: Etienne Robillard | Owner: nobody
Type: New feature | Status: closed

Component: Core (URLs) | Version: 1.10
Severity: Normal | Resolution: needsinfo
Keywords: | Triage Stage: Unreviewed

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

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


Comment:

Please reopen if you can add more details and provide a tested patch.

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

Reply all
Reply to author
Forward
0 new messages