web/views/urlpublishing.py
changeset 7794 aed065b97f12
parent 7272 771f594c12a2
child 7828 749e1a67987f
--- a/web/views/urlpublishing.py	Wed Sep 14 09:55:51 2011 +0200
+++ b/web/views/urlpublishing.py	Thu Sep 15 16:40:52 2011 +0200
@@ -195,16 +195,17 @@
         return None, rset
 
     def handle_etype_attr(self, req, cls, attrname, value):
-        rql = cls.fetch_rql(req.user, ['X %s %%(x)s' % (attrname)],
-                            mainvar='X', ordermethod=None)
+        st = cls.fetch_rqlst(req.user, ordermethod=None)
+        st.add_constant_restriction(st.get_variable('X'), attrname,
+                                    'x', 'Substitute')
         if attrname == 'eid':
             try:
-                rset = req.execute(rql, {'x': typed_eid(value)})
+                rset = req.execute(st.as_string(), {'x': typed_eid(value)})
             except (ValueError, TypeResolverException):
                 # conflicting eid/type
                 raise PathDontMatch()
         else:
-            rset = req.execute(rql, {'x': value})
+            rset = req.execute(st.as_string(), {'x': value})
         self.set_vid_for_rset(req, cls, rset)
         return None, rset