1.1 --- a/imipweb/resource.py Mon Sep 28 00:03:47 2015 +0200
1.2 +++ b/imipweb/resource.py Mon Sep 28 00:28:39 2015 +0200
1.3 @@ -26,6 +26,7 @@
1.4 from imiptools.period import remove_period, remove_affected_period
1.5 from imipweb.data import event_period_from_period, form_period_from_period, FormDate
1.6 from imipweb.env import CGIEnvironment
1.7 +from urllib import urlencode
1.8 import babel.dates
1.9 import imip_store
1.10 import markup
1.11 @@ -81,17 +82,19 @@
1.12 self.new_page(title="Redirect")
1.13 self.page.p("Redirecting to: %s" % url)
1.14
1.15 - def link_to(self, uid, recurrenceid=None):
1.16 + def link_to(self, uid, recurrenceid=None, args=None):
1.17
1.18 """
1.19 Return a link to an object with the given 'uid' and 'recurrenceid'.
1.20 See get_identifiers for the decoding of such links.
1.21 +
1.22 + If 'args' is specified, the given dictionary is encoded and included.
1.23 """
1.24
1.25 path = [uid]
1.26 if recurrenceid:
1.27 path.append(recurrenceid)
1.28 - return self.env.new_url("/".join(path))
1.29 + return "%s%s" % (self.env.new_url("/".join(path)), args and ("?%s" % urlencode(args)) or "")
1.30
1.31 # Access to objects.
1.32