nicer add urls 3.5
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 16 Sep 2009 19:25:08 +0200
branch3.5
changeset 3272 f46f2082468b
parent 3271 6c8504b2ade0
child 3273 ca78d07aaffe
nicer add urls
web/action.py
web/views/actions.py
--- a/web/action.py	Wed Sep 16 19:25:01 2009 +0200
+++ b/web/action.py	Wed Sep 16 19:25:08 2009 +0200
@@ -93,8 +93,7 @@
     def url(self):
         current_entity = self.rset.get_entity(self.row or 0, self.col or 0)
         linkto = '%s:%s:%s' % (self.rtype, current_entity.eid, target(self))
-        return self.build_url(vid='creation', etype=self.etype,
-                              __linkto=linkto,
+        return self.build_url('add/%s' % self.etype, __linkto=linkto,
                               __redirectpath=current_entity.rest_path(), # should not be url quoted!
                               __redirectvid=self.req.form.get('__redirectvid', ''))
 
--- a/web/views/actions.py	Wed Sep 16 19:25:01 2009 +0200
+++ b/web/views/actions.py	Wed Sep 16 19:25:08 2009 +0200
@@ -285,7 +285,7 @@
                         yield rschema, teschema, role
 
     def linkto_url(self, entity, rtype, etype, target):
-        return self.build_url(vid='creation', etype=etype,
+        return self.build_url('add/%s' % etype,
                               __linkto='%s:%s:%s' % (rtype, entity.eid, target),
                               __redirectpath=entity.rest_path(), # should not be url quoted!
                               __redirectvid=self.req.form.get('vid', ''))