Opened 8 years ago

Closed 8 years ago

Last modified 8 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, 8 years ago

Resolution: duplicate
Status: newclosed

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

Last edited 8 years ago by Tim Graham (previous) (diff)

comment:2 by TZanke, 8 years ago

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