Skip to content

Commit

Permalink
Added a decode_query() convenience function.
Browse files Browse the repository at this point in the history
  • Loading branch information
mitsuhiko committed May 26, 2013
1 parent 99b102a commit 341cd45
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions werkzeug/urls.py
Expand Up @@ -110,6 +110,13 @@ def password(self):
"""The password if it was part of the URL, `None` otherwise."""
return self._split_auth()[1]

def decode_query(self, *args, **kwargs):
"""Decodes the query part of the URL. Ths is a shortcut for
calling :func:`url_decode` on the query argument. The arguments and
keyword arguments are forwarded to :func:`url_decode` unchanged.
"""
return url_decode(self.query or '', *args, **kwargs)

def _split_netloc(self):
if '@' in self.netloc:
return self.netloc.split('@', 1)
Expand Down

0 comments on commit 341cd45

Please sign in to comment.