web/views/urlrewrite.py
branchstable
changeset 3856 1c9589e46b16
parent 3592 4c08780e54ed
child 3864 2fee9151c6b2
--- a/web/views/urlrewrite.py	Mon Nov 16 10:32:06 2009 +0100
+++ b/web/views/urlrewrite.py	Mon Nov 16 10:52:45 2009 +0100
@@ -7,6 +7,7 @@
 """
 import re
 
+from cubicweb import typed_eid
 from cubicweb.appobject import AppObject
 
 
@@ -152,6 +153,8 @@
         if rql:
             kwargs = args and args.copy() or {}
             if argsgroups:
+                if cachekey is not None and isinstance(cachekey, basestring):
+                    cachekey = (cachekey,)
                 match = inputurl.match(uri)
                 for key in argsgroups:
                     value = match.group(key)
@@ -159,6 +162,8 @@
                         kwargs[key] = transforms[key](value)
                     except KeyError:
                         kwargs[key] = value
+                    if key in cachekey:
+                        kwargs[key] = typed_eid(value)
             if setuser:
                 kwargs['u'] = req.user.eid
             rset = req.execute(rql, kwargs, cachekey)