[Django] #27440: add request as optional argument to django.urls.base.urls.reverse in order to get fully qualified URL

21 views
Skip to first unread message

Django

unread,
Nov 5, 2016, 7:57:05 AM11/5/16
to django-...@googlegroups.com
#27440: add request as optional argument to django.urls.base.urls.reverse in order
to get fully qualified URL
-------------------------------------+-------------------------------------
Reporter: Mislav | Owner: Mislav Cimperšak
Cimperšak |
Type: New | Status: assigned
feature |
Component: Core | Version: 1.10
(URLs) | Keywords: reverse, request,
Severity: Normal | full url
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
I'm adding an optional argument `request` to
`django.urls.base.urls.reverse`method.
The idea is that using `request` object one can get a fully qualified url.

The idea is taken from Django Rest Framework
([https://github.com/tomchristie/django-rest-
framework/blob/master/rest_framework/reverse.py#L55-L59 link to it]).

I'm in Amsterdam on the sprint and plan to do it here.
The patch and few tests are already written, just need to add docs.

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

Django

unread,
Nov 5, 2016, 7:57:42 AM11/5/16
to django-...@googlegroups.com
#27440: add `request` as optional argument to `django.urls.base.urls.reverse` in
order to get fully qualified URL
-------------------------------------+-------------------------------------
Reporter: Mislav Cimperšak | Owner: Mislav
| Cimperšak
Type: New feature | Status: assigned
Component: Core (URLs) | Version: 1.10
Severity: Normal | Resolution:
Keywords: reverse, request, | Triage Stage:
full url | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

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

Django

unread,
Nov 5, 2016, 8:50:22 AM11/5/16
to django-...@googlegroups.com
#27440: add `request` as optional argument to `django.urls.base.urls.reverse` in
order to get fully qualified URL
-------------------------------------+-------------------------------------
Reporter: Mislav Cimperšak | Owner: Mislav
| Cimperšak
Type: New feature | Status: assigned
Component: Core (URLs) | Version: 1.10
Severity: Normal | Resolution:
Keywords: reverse, request, | Triage Stage:
full url | Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mislav Cimperšak):

* has_patch: 0 => 1


Comment:

added patch: [https://github.com/django/django/pull/7484 PR]

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

Django

unread,
Nov 5, 2016, 9:20:34 AM11/5/16
to django-...@googlegroups.com
#27440: add `request` as optional argument to `django.urls.base.urls.reverse` in
order to get fully qualified URL
-------------------------------------+-------------------------------------
Reporter: Mislav Cimperšak | Owner: Mislav
| Cimperšak
Type: New feature | Status: assigned
Component: Core (URLs) | Version: 1.10
Severity: Normal | Resolution:
Keywords: reverse, request, | Triage Stage: Accepted
full url |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by mr-bo-jangles):

* stage: Unreviewed => Accepted


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

Django

unread,
Nov 5, 2016, 11:07:58 AM11/5/16
to django-...@googlegroups.com
#27440: Allow reverse() to return a fully qualified URL
-------------------------------------+-------------------------------------

Reporter: Mislav Cimperšak | Owner: Mislav
| Cimperšak
Type: New feature | Status: assigned
Component: Core (URLs) | Version: 1.10
Severity: Normal | Resolution:
Keywords: reverse, request, | Triage Stage: Accepted
full url |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham):

[https://groups.google.com/d/topic/django-
developers/-rbLcdJkIpk/discussion django-developers thread]

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

Django

unread,
Nov 11, 2016, 6:56:00 AM11/11/16
to django-...@googlegroups.com
#27440: Allow reverse() to return a fully qualified URL
-------------------------------------+-------------------------------------

Reporter: Mislav Cimperšak | Owner: Mislav
| Cimperšak
Type: New feature | Status: assigned
Component: Core (URLs) | Version: 1.10
Severity: Normal | Resolution:
Keywords: reverse, request, | Triage Stage: Accepted
full url |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

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

* needs_better_patch: 0 => 1


Comment:

There isn't consensus on the mailing list that passing `request` to
`reverse()` is the best approach.

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

Django

unread,
Nov 11, 2016, 10:30:55 AM11/11/16
to django-...@googlegroups.com
#27440: Allow reverse() to return a fully qualified URL
-------------------------------------+-------------------------------------

Reporter: Mislav Cimperšak | Owner: Mislav
| Cimperšak
Type: New feature | Status: closed

Component: Core (URLs) | Version: 1.10
Severity: Normal | Resolution: wontfix

Keywords: reverse, request, | Triage Stage: Accepted
full url |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mislav Cimperšak):

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


Comment:

Closing the issue as discussed on google-groups.

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

Reply all
Reply to author
Forward
0 new messages