1.1 --- a/imipweb/resource.py Tue Oct 06 18:38:45 2015 +0200
1.2 +++ b/imipweb/resource.py Tue Oct 06 18:43:29 2015 +0200
1.3 @@ -195,14 +195,6 @@
1.4 def _format_datetime(self, fn, dt, format):
1.5 return fn(dt, format=format, locale=self.get_user_locale())
1.6
1.7 - # Data management methods.
1.8 -
1.9 - def remove_request(self, uid, recurrenceid=None):
1.10 - return self.store.dequeue_request(self.user, uid, recurrenceid)
1.11 -
1.12 - def remove_event(self, uid, recurrenceid=None):
1.13 - return self.store.remove_event(self.user, uid, recurrenceid)
1.14 -
1.15 class ResourceClient(Resource, Client):
1.16
1.17 "A Web application resource and calendar client."
1.18 @@ -366,6 +358,29 @@
1.19
1.20 "Utility methods resource mix-in."
1.21
1.22 + def prefixed_args(self, prefix, convert=None):
1.23 +
1.24 + """
1.25 + Return values for all arguments having the given 'prefix' in their
1.26 + names, removing the prefix to obtain each value from the argument name
1.27 + itself. The 'convert' callable can be specified to perform a conversion
1.28 + (to int, for example).
1.29 + """
1.30 +
1.31 + args = self.env.get_args()
1.32 +
1.33 + values = []
1.34 + for name in args.keys():
1.35 + if name.startswith(prefix):
1.36 + value = name[len(prefix):]
1.37 + if convert:
1.38 + try:
1.39 + value = convert(value)
1.40 + except ValueError:
1.41 + pass
1.42 + values.append(value)
1.43 + return values
1.44 +
1.45 def control(self, name, type, value, selected=False, **kw):
1.46
1.47 """