135 submenu = 'addrelated' |
135 submenu = 'addrelated' |
136 # to be defined in concrete classes |
136 # to be defined in concrete classes |
137 target_etype = rtype = None |
137 target_etype = rtype = None |
138 |
138 |
139 def url(self): |
139 def url(self): |
140 try: |
140 ttype = self.target_etype |
141 # deprecated in 3.6, already warned by the selector |
|
142 ttype = self.etype # pylint: disable=E1101 |
|
143 except AttributeError: |
|
144 ttype = self.target_etype |
|
145 entity = self.cw_rset.get_entity(self.cw_row or 0, self.cw_col or 0) |
141 entity = self.cw_rset.get_entity(self.cw_row or 0, self.cw_col or 0) |
146 linkto = '%s:%s:%s' % (self.rtype, entity.eid, target(self)) |
142 linkto = '%s:%s:%s' % (self.rtype, entity.eid, target(self)) |
147 return self._cw.vreg["etypes"].etype_class(ttype).cw_create_url(self._cw, |
143 return self._cw.vreg["etypes"].etype_class(ttype).cw_create_url(self._cw, |
148 __redirectpath=entity.rest_path(), __linkto=linkto, |
144 __redirectpath=entity.rest_path(), __linkto=linkto, |
149 __redirectvid=self._cw.form.get('__redirectvid', '')) |
145 __redirectvid=self._cw.form.get('__redirectvid', '')) |