How about a wrapper over reverse?
Modifying reverse will lead to multiple changes in core urlresolver.
A class based urlresolver can be implemented which will call reverse
internally.
On Friday, 23 October 2015 17:29:25 UTC+5:30, guettli wrote:
>
> API proposal:
>
> Add a new kwarg to reverse():
>
> reverse(..., get=None)
>
>
> Example: reverse('my_view_name', kwargs={'pk': '1'}, get=dict(param='value')
>
> result: /my-view/1?param=value
>
>
>
>
> Am Freitag, 23. Oktober 2015 13:43:18 UTC+2 schrieb Tim Graham:
>>
>> Can you make an API proposal?
>>
>> On Friday, October 23, 2015 at 3:41:42 AM UTC-4, guettli wrote:
>>>
>>> From https://code.djangoproject.com/ticket/25582
>>>
>>> {{{
>>>
>>> It is a common question on stackoverflow and other places:
>>>
>>> How to reverse() to url including GET parameters? Example:
>>> .../myview?foo=bar
>>>
>>>
>>> http://stackoverflow.com/questions/9585491/how-do-i-pass-get-parameters-using-django-urlresolvers-reverse
>>>
>>> http://stackoverflow.com/a/27641445/633961
>>>
>>> It would be very nice if django could implement a short-cut which
>>> provides
>>> this.
>>> It would be useful for python code and template, too.
>>> }}}
>>>
>>> {{{
>>> If we do add it, it likely needs a discussion on the
>>> DevelopersMailingList
>>> <https://code.djangoproject.com/wiki/DevelopersMailingList> to figure
>>> out what the API should look like. See also #10941
>>> <https://code.djangoproject.com/ticket/10941> which asks for a template
>>> tag for creating query strings in templates.
>>> }}}
>>>
>>> What do you think?
>>>
>>>
>>>
>>>
--
You received this message because you are subscribed to the Google Groups
"Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-developers/b7b53d11-eb6d-46e4-8a98-2a7c5f2fd991%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.