Branko Vukelic  committed be6884d

Documented hash property

  • Participants
  • Parent commits b5c9c58
  • Branches master

Comments (0)

Files changed (1)

 + ``query_dict``: ``QueryDict`` instance containing the URL's query parameters
 + ``query``: similar to ``query_dict`` but also does more when assigning
 + ``query_string``: URL's query string
++ ``hash``: MD5 hexdigest of the full path including query parameters
     u.query_string = 'foo=1&bar=2'       # this works
     u.query_string = dict(foo=1, bar=2)  # but this doesn't
+Returns the MD5 hexdigest of the full path including query parameters. This can
+be useful for use with caching and other situations where we need to
+differentiate same paths with different query parameters. ::
+    u = UrlHelper('/foo/bar')
+    u.query = dict(foo=1) # URL is now '/foo/bar?foo=1'
+    u.hash  # returns '06f0a42bdd474f053fb1343165a31d42'
 URL tools currently has only one template tag, which is an assignment tag.
+{% add_params %}
+This template tag outputs a path with query string parameters given as keyword
+arguments. For instance, if we are on a page at ``/foo``, we can use this tag::
+    {% add_params request.get_full_path foo='bar' %}
+and the output would be::
+    ``/foo?foo=bar``
+Existing URL parameters are overridden by the ones specified as keyword
 {% url_params %}
 This tag is used as an assignment tag. Its first argument is an URL, followed
 by any number of keyword arguments that represent the URL parameters. For