Marc mentioned in that ticket "Reversing by dotted path to view is just a
bad idea."
--
Ticket URL: <https://code.djangoproject.com/ticket/22384>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by timo):
I plan to work on this, but will wait to ensure that there are no -1's to
the idea, raising it on the mailing list if necessary.
--
Ticket URL: <https://code.djangoproject.com/ticket/22384#comment:1>
* stage: Unreviewed => Accepted
Comment:
+1 from me.
--
Ticket URL: <https://code.djangoproject.com/ticket/22384#comment:2>
Comment (by aaugustin):
2.0 is a pretty good target for the final removal of this feature.
--
Ticket URL: <https://code.djangoproject.com/ticket/22384#comment:3>
Comment (by Gwildor):
I agree that reversing by dotted-path-to-view is "a bad idea". I would
even say it's just ridiculous, and I didn't even knew it existed.
Obviously you should just use the url name. What would actually happen
when you have two urls to the same view? Anyway, I'm all for deprecating
that feature.
On the other hand, I'm not entirely convinced about deprecating the
dotted-path-to-view in url feature. There are a lot of settings and other
things in Django which work that way, and it's a nice feature which
prevents the imports from cluttering for the people who are still pro
FBV's. Unless it opens up the possibility of removing the necessity of
calling `as_view()` on every CBV in the urls. If deprecating this feature
is part of a bigger plan to migrate to cleaner urls for CBV's, then I'm
all for it.
--
Ticket URL: <https://code.djangoproject.com/ticket/22384#comment:4>
Comment (by marfire):
+1 from me. Are there any use cases where someone needs the string version
in `urls.py` to avoid a circular imports problem? Not that I can think of,
but I thought I'd mention it...
--
Ticket URL: <https://code.djangoproject.com/ticket/22384#comment:5>
Comment (by FunkyBob):
Gwildor, the feature pre-dates named url patterns [yes, there wasn't
always that feature].
Also, as I'm sure Alex will point out, it can make debugging harder, as
the error of a wrong import won't always show up, and will appear to come
from the wrong place when it does fire off.
This will have no impact on needing to call as_view on CBV. The as_view
method is a view function factory -- it is what makes the actual view
function used to invoke the CBV... you can't do without it.
--
Ticket URL: <https://code.djangoproject.com/ticket/22384#comment:6>
* has_patch: 0 => 1
Comment:
I've reduced the scope of this ticket to only deprecating the ability to
reverse by dotted path (instead of also removing the "string magic" in
`url()`). I'll save that bit for a future ticket.
[https://github.com/django/django/pull/2754 Pull request] is up for
review.
--
Ticket URL: <https://code.djangoproject.com/ticket/22384#comment:7>
* stage: Accepted => Ready for checkin
Comment:
I left some comments on the PR. Except the doc issue it looks RFC.
--
Ticket URL: <https://code.djangoproject.com/ticket/22384#comment:8>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"4445d36d471aae81086ed785536687a92e5aaa6d"]:
{{{
#!CommitTicketReference repository=""
revision="4445d36d471aae81086ed785536687a92e5aaa6d"
Fixed #22384 -- Deprecated reversing URLs by dotted path.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/22384#comment:9>
Comment (by Tim Graham <timograham@…>):
In [changeset:"250e2b422b4da93f38cd61319b9b3c9f422e6ede"]:
{{{
#!CommitTicketReference repository=""
revision="250e2b422b4da93f38cd61319b9b3c9f422e6ede"
Silenced some GIS deprecation warnings; refs #22384.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/22384#comment:10>
Comment (by Loic Bistuer <loic.bistuer@…>):
In [changeset:"45840927d3516770be2654422e752357d5c063a5"]:
{{{
#!CommitTicketReference repository=""
revision="45840927d3516770be2654422e752357d5c063a5"
Silenced some deprecation warnings in contrib.sitemaps; refs #22384.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/22384#comment:11>
Comment (by Tim Graham <timograham@…>):
In [changeset:"785cc71d5b3300e2702b0b2fc7316e58ca70b563" 785cc71]:
{{{
#!CommitTicketReference repository=""
revision="785cc71d5b3300e2702b0b2fc7316e58ca70b563"
Refs #22384 -- Removed the ability to reverse URLs by dotted path per
deprecation timeline.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/22384#comment:12>
Comment (by Tim Graham <timograham@…>):
In [changeset:"6348db378a8fef555aba30761857ef161112b499" 6348db37]:
{{{
#!CommitTicketReference repository=""
revision="6348db378a8fef555aba30761857ef161112b499"
Refs #22384 -- Removed obsolete code for the removal of reversing by
dotted path.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/22384#comment:13>
Comment (by Tim Graham <timograham@…>):
In [changeset:"4e400dcb79bc468ee1ff899312a00ed8dc3e795c" 4e400dc]:
{{{
#!CommitTicketReference repository=""
revision="4e400dcb79bc468ee1ff899312a00ed8dc3e795c"
Refs #22384 -- Readded RegexURLResolver.reverse().
It was removed in 785cc71d5b3300e2702b0b2fc7316e58ca70b563 only because
it was untested and unused in Django itself, however, some third-party
apps use it.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/22384#comment:14>
Comment (by Tim Graham <timograham@…>):
In [changeset:"8c25d8fc10f017ed3f8e7bf97eb936495135632e" 8c25d8fc]:
{{{
#!CommitTicketReference repository=""
revision="8c25d8fc10f017ed3f8e7bf97eb936495135632e"
[1.10.x] Refs #22384 -- Readded RegexURLResolver.reverse().
It was removed in 785cc71d5b3300e2702b0b2fc7316e58ca70b563 only because
it was untested and unused in Django itself, however, some third-party
apps use it.
Backport of 4e400dcb79bc468ee1ff899312a00ed8dc3e795c from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/22384#comment:15>