Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#26276 closed New feature (duplicate)

GET parameter and fragment identifier for reverse and url template tag

Reported by: Sven R. Kunze Owned by: nobody
Component: Core (URLs) Version: dev
Severity: Normal Keywords:
Cc: tzanke@… Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Would you be interested in an addition to reverse and {% url %} which provides the ability to add urlencoded GET parameters and fragment identifier?

def reverse(viewname, urlconf=None, args=None, kwargs=None, prefix=None, current_app=None, query=None, fragment=None):
    base_url = django.reverse(viewname, urlconf, args, kwargs, prefix, current_app)
    query = '?' + urllib.urlencode(query) if query else  ''
    fragment = '#' + urllib.quote(fragment) if fragment else ''
    return base_url + query + fragment

Change History (2)

comment:1 by Tim Graham, 9 years ago

Resolution: duplicate
Status: newclosed

Seems like a duplicate of #26276. The actual solution is still under discussion.

Version 0, edited 9 years ago by Tim Graham (next)

comment:2 by TZanke, 9 years ago

Cc: tzanke@… added
Note: See TracTickets for help on using tickets.
Back to Top