[Django] #17551: Namespaces declared in different places

15 views
Skip to first unread message

Django

unread,
Jan 16, 2012, 5:37:42 PM1/16/12
to django-...@googlegroups.com
#17551: Namespaces declared in different places
-------------------------------+--------------------
Reporter: Kronuz | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 1.3
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------
Currently, if the same namespace is declared for different included urls,
only one included `urls` module gets the namespace.

In this scenario:
{{{
urlpatterns = patterns('',
url(r'^first/', include('first.urls')),
url(r'^first_default/', include('first.urls', app_name='first',
namespace='first')),
url(r'^first_in_a/', include('first.urls', app_name='first',
namespace='A')),
url(r'^first_in_b/', include('first.urls', app_name='first',
namespace='B')),
url(r'^second/', include('second.urls')),
url(r'^second_default/', include('second.urls', app_name='second',
namespace='second')),
url(r'^second_in_a/', include('second.urls', app_name='second',
namespace='A')),
url(r'^second_in_b/', include('second.urls', app_name='second',
namespace='B')),
)
}}}

The expected output is:
{{{
reverse('first') -> /first/
reverse('second') -> /second/
reverse('A:first') -> /first_in_a/
reverse('A:second') -> /second_in_a/
reverse('B:first') -> /first_in_b/
reverse('B:second') -> /second_in_b/
}}}

But instead is:
{{{
reverse('first') -> /first/
reverse('second') -> /second/
reverse('A:first') -> /first_in_a/
reverse('A:second') -> NoReverseMatch
reverse('B:first') -> /first_in_b/
reverse('B:second') -> NoReverseMatch
}}}

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

Django

unread,
Jan 16, 2012, 5:44:43 PM1/16/12
to django-...@googlegroups.com
#17551: Namespaces declared in different places
-------------------------------+--------------------------------------
Reporter: Kronuz | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 1.3
Severity: Normal | Resolution:
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 Kronuz):

* cc: Kronuz (added)
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0


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

Django

unread,
Feb 4, 2012, 12:14:46 PM2/4/12
to django-...@googlegroups.com
#17551: Namespaces declared in different places
-------------------------------+--------------------------------------
Reporter: Kronuz | Owner: gnosek
Type: Uncategorized | Status: assigned
Component: Core (URLs) | Version: 1.3
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by gnosek):

* owner: nobody => gnosek
* needs_better_patch: 0 => 1
* has_patch: 0 => 1
* status: new => assigned
* component: Uncategorized => Core (URLs)


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

Django

unread,
Feb 4, 2012, 4:01:55 PM2/4/12
to django-...@googlegroups.com
#17551: Namespaces declared in different places
-------------------------------+--------------------------------------
Reporter: Kronuz | Owner: gnosek
Type: Uncategorized | Status: assigned
Component: Core (URLs) | Version: 1.3
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 gnosek):

* needs_better_patch: 1 => 0


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

Django

unread,
Feb 5, 2012, 5:43:06 AM2/5/12
to django-...@googlegroups.com
#17551: Namespaces declared in different places
-----------------------------+------------------------------------
Reporter: Kronuz | Owner: gnosek
Type: Bug | Status: assigned
Component: Core (URLs) | Version: 1.3
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+------------------------------------
Changes (by jezdez):

* type: Uncategorized => Bug
* stage: Unreviewed => Accepted


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

Django

unread,
Feb 5, 2012, 6:28:02 AM2/5/12
to django-...@googlegroups.com
#17551: Namespaces declared in different places
-----------------------------+---------------------------------------------
Reporter: Kronuz | Owner: gnosek
Type: Bug | Status: assigned
Component: Core (URLs) | Version: 1.3
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+---------------------------------------------
Changes (by oinopion):

* stage: Accepted => Ready for checkin


Comment:

Good for me.

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

Django

unread,
Feb 5, 2012, 6:28:22 AM2/5/12
to django-...@googlegroups.com
#17551: Namespaces declared in different places
-----------------------------+---------------------------------------------
Reporter: Kronuz | Owner: gnosek
Type: Bug | Status: assigned
Component: Core (URLs) | Version: 1.4-alpha-1
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+---------------------------------------------
Changes (by oinopion):

* version: 1.3 => 1.4-alpha-1


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

Django

unread,
Feb 10, 2012, 6:13:32 PM2/10/12
to django-...@googlegroups.com
#17551: Namespaces declared in different places
-------------------------------------+-------------------------------------
Reporter: Kronuz | Owner: gnosek
Type: Bug | Status: assigned
Component: Core (URLs) | Version:
Severity: Release blocker | 1.4-alpha-1
Keywords: | Resolution:
Has patch: 1 | Triage Stage: Ready for
Needs tests: 0 | checkin
Easy pickings: 0 | Needs documentation: 0
| Patch needs improvement: 0
| UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by PaulM):

* severity: Normal => Release blocker


Comment:

Marking as a release blocker

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

Django

unread,
Mar 1, 2012, 4:53:49 PM3/1/12
to django-...@googlegroups.com
#17551: Namespaces declared in different places
-----------------------------+---------------------------------------------
Reporter: Kronuz | Owner: gnosek
Type: Bug | Status: assigned
Component: Core (URLs) | Version: 1.4-alpha-1
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+---------------------------------------------
Changes (by aaugustin):

* severity: Release blocker => Normal


Comment:

After further discussion, this isn't really a release blocker, since it
isn't a regression or a major bug in a new feature.

However, the patch looks correct and stands a good chance to be committed
before 1.4.

I've spend a few hours on it, but I don't feel sufficiently familiar with
the URL namespacing feature to commit it. I asked Russell (the original
author) if he could take a look.

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

Django

unread,
Sep 7, 2012, 10:50:47 AM9/7/12
to django-...@googlegroups.com
#17551: Namespaces declared in different places
-----------------------------+---------------------------------------
Reporter: Kronuz | Owner: gnosek
Type: Bug | Status: assigned
Component: Core (URLs) | Version: 1.4-alpha-1
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+---------------------------------------
Changes (by aaugustin):

* stage: Ready for checkin => Accepted


Comment:

After discussion with Malcolm (the other author), this rather looks like a
misuse of `app_name`.

This could be resolved by improving the documentation rather than changing
the code.

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

Django

unread,
Nov 8, 2012, 8:25:17 AM11/8/12
to django-...@googlegroups.com
#17551: Namespaces declared in different places
-----------------------------+---------------------------------------
Reporter: Kronuz | Owner: gnosek
Type: Bug | Status: assigned
Component: Core (URLs) | Version: 1.4-alpha-1
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-----------------------------+---------------------------------------

Comment (by Kronuz):

I really wish this could be checked in since, even of it's a "missuse"
given the original design, I believe it to be a good addition which just
further increases the url resolvers code isometry and flexibly allows the
use of the same namespace name across apps; *plus* it doesn't really break
anything, and covers a legit and intuitive use case of namespaces.

Any other thoughts about this ticket?

--
Ticket URL: <https://code.djangoproject.com/ticket/17551#comment:10>

Django

unread,
Jun 24, 2014, 9:05:58 PM6/24/14
to django-...@googlegroups.com
#17551: Namespaces declared in different places
-------------------------------------+-------------------------------------
Reporter: Kronuz | Owner: gnosek
Type: | Status: assigned
Cleanup/optimization | Version:
Component: Documentation | 1.4-alpha-1

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

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

* type: Bug => Cleanup/optimization
* has_patch: 1 => 0
* component: Core (URLs) => Documentation


Comment:

Moving to documentation based on Aymeric's comment 22. If someone wants to
lobby for a design change, please start a thread on the
DevelopersMailingList.

--
Ticket URL: <https://code.djangoproject.com/ticket/17551#comment:11>

Django

unread,
Jun 30, 2014, 6:21:25 PM6/30/14
to django-...@googlegroups.com
#17551: Namespaces declared in different places
-------------------------------------+-------------------------------------
Reporter: Kronuz | Owner: gnosek
Type: | Status: closed

Cleanup/optimization | Version:
Component: Documentation | 1.4-alpha-1
Severity: Normal | Resolution: duplicate

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

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

* status: assigned => closed
* resolution: => duplicate


Comment:

I think we can roll this documentation into #17707 - "Docs for URL
namespaces should explain the motivation and use cases".

--
Ticket URL: <https://code.djangoproject.com/ticket/17551#comment:12>

Django

unread,
Sep 5, 2014, 3:36:23 PM9/5/14
to django-...@googlegroups.com
#17551: Namespaces declared in different places
-------------------------------------+-------------------------------------
Reporter: Kronuz | Owner: gnosek
Type: | Status: closed
Cleanup/optimization | Version:
Component: Documentation | 1.4-alpha-1
Severity: Normal | Resolution: invalid

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

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

* resolution: duplicate => invalid


Comment:

It's [https://docs.djangoproject.com/en/dev/topics/http/urls/#term-
instance-namespace documented] that "Instance namespaces should be unique
across your entire project." That seems to be the issue here.

--
Ticket URL: <https://code.djangoproject.com/ticket/17551#comment:13>

Reply all
Reply to author
Forward
0 new messages