web/action.py
branchstable
changeset 7806 aa30c665bd06
parent 7793 8a330017ca4d
child 7879 9aae456abab5
equal deleted inserted replaced
7805:7111bb64b58f 7806:aa30c665bd06
     1 # copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
     1 # copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
     2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
     2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
     3 #
     3 #
     4 # This file is part of CubicWeb.
     4 # This file is part of CubicWeb.
     5 #
     5 #
     6 # CubicWeb is free software: you can redistribute it and/or modify it under the
     6 # CubicWeb is free software: you can redistribute it and/or modify it under the
   139             ttype = self.etype # deprecated in 3.6, already warned by the selector
   139             ttype = self.etype # deprecated in 3.6, already warned by the selector
   140         except AttributeError:
   140         except AttributeError:
   141             ttype = self.target_etype
   141             ttype = self.target_etype
   142         entity = self.cw_rset.get_entity(self.cw_row or 0, self.cw_col or 0)
   142         entity = self.cw_rset.get_entity(self.cw_row or 0, self.cw_col or 0)
   143         linkto = '%s:%s:%s' % (self.rtype, entity.eid, target(self))
   143         linkto = '%s:%s:%s' % (self.rtype, entity.eid, target(self))
   144         return self._cw.build_url('add/%s' % ttype, __linkto=linkto,
   144         return self._cw.vreg["etypes"].etype_class(ttype).cw_create_url(self._cw,
   145                                   __redirectpath=entity.rest_path(),
   145                                   __redirectpath=entity.rest_path(), __linkto=linkto,
   146                                   __redirectvid=self._cw.form.get('__redirectvid', ''))
   146                                   __redirectvid=self._cw.form.get('__redirectvid', ''))
   147 
   147