web/views/actions.py
branchstable
changeset 7806 aa30c665bd06
parent 7782 40a49f4350a5
child 7807 f2a5805615f8
child 7947 64719f6933d4
--- a/web/views/actions.py	Fri Sep 16 17:10:33 2011 +0200
+++ b/web/views/actions.py	Fri Sep 16 16:42:42 2011 +0200
@@ -248,7 +248,7 @@
         return self._cw.__('add a %s' % self.rsettype) # generated msgid
 
     def url(self):
-        return self._cw.build_url('add/%s' % self.rsettype)
+        return self._cw.vreg["etypes"].etype_class(self.rsettype).cw_create_url(self._cw)
 
 
 class AddRelatedActions(action.Action):
@@ -319,8 +319,9 @@
                         yield rschema, teschema, role
 
     def linkto_url(self, entity, rtype, etype, target, **kwargs):
-        return self._cw.build_url('add/%s' % etype,
-                                  __linkto='%s:%s:%s' % (rtype, entity.eid, target), **kwargs)
+        return self._cw.vreg["etypes"].etype_class(etype).cw_create_url(
+                self._cw, __linkto='%s:%s:%s' % (rtype, entity.eid, target),
+                **kwargs)
 
 
 class ViewSameCWEType(action.Action):