MCPcopy
hub / github.com/django/django / quote

Function quote

django/contrib/admin/utils.py:91–98  ·  view source on GitHub ↗

Ensure that primary key values do not confuse the admin URLs by escaping any '/', '_' and ':' and similarly problematic characters. Similar to urllib.parse.quote(), except that the quoting is slightly different so that it doesn't get automatically unquoted by the web browser.

(s)

Source from the content-addressed store, hash-verified

89
90
91def quote(s):
92 """
93 Ensure that primary key values do not confuse the admin URLs by escaping
94 any '/', '_' and ':' and similarly problematic characters.
95 Similar to urllib.parse.quote(), except that the quoting is slightly
96 different so that it doesn't get automatically unquoted by the web browser.
97 """
98 return s.translate(QUOTE_MAP) if isinstance(s, str) else s
99
100
101def unquote(s):

Calls

no outgoing calls

Used in the wild real call sites across dependent graphs

searching dependent graphs…