web/views/reledit.py
changeset 10669 155c29e0ed1c
parent 10666 7f6b5f023884
child 10907 9ae707db5265
equal deleted inserted replaced
10668:4fb62d791073 10669:155c29e0ed1c
   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