equal
deleted
inserted
replaced
257 if action in ('edit_related', 'delete'): |
257 if action in ('edit_related', 'delete'): |
258 edit_entity = entity.related(rschema, role).get_entity(0, 0) |
258 edit_entity = entity.related(rschema, role).get_entity(0, 0) |
259 elif action == 'add': |
259 elif action == 'add': |
260 add_etype = self._compute_ttypes(rschema, role)[0] |
260 add_etype = self._compute_ttypes(rschema, role)[0] |
261 _new_entity = self._cw.vreg['etypes'].etype_class(add_etype)(self._cw) |
261 _new_entity = self._cw.vreg['etypes'].etype_class(add_etype)(self._cw) |
262 _new_entity.eid = self._cw.varmaker.next() |
262 _new_entity.eid = next(self._cw.varmaker) |
263 edit_entity = _new_entity |
263 edit_entity = _new_entity |
264 # XXX see forms.py ~ 276 and entities.linked_to method |
264 # XXX see forms.py ~ 276 and entities.linked_to method |
265 # is there another way? |
265 # is there another way? |
266 self._cw.form['__linkto'] = '%s:%s:%s' % (rschema, entity.eid, neg_role(role)) |
266 self._cw.form['__linkto'] = '%s:%s:%s' % (rschema, entity.eid, neg_role(role)) |
267 assert edit_entity |
267 assert edit_entity |