web/views/autoform.py
branchstable
changeset 4626 c26b4df9fc90
parent 4625 d8c3a50a8ee7
child 4629 1eeef3cbf528
equal deleted inserted replaced
4625:d8c3a50a8ee7 4626:c26b4df9fc90
   173                   & specified_etype_implements('Any'))
   173                   & specified_etype_implements('Any'))
   174 
   174 
   175     @property
   175     @property
   176     def removejs(self):
   176     def removejs(self):
   177         entity = self._entity()
   177         entity = self._entity()
   178         card = entity.e_schema.rdef(self.rtype, neg_role(self.role)).role_cardinality(self.role)
   178         ttype = self._cw.entity_from_eid(self.peid).__regid__
       
   179         rdef = entity.e_schema.rdef(self.rtype, neg_role(self.role), ttype)
       
   180         card= rdef.role_cardinality(self.role)
   179         # when one is adding an inline entity for a relation of a single card,
   181         # when one is adding an inline entity for a relation of a single card,
   180         # the 'add a new xxx' link disappears. If the user then cancel the addition,
   182         # the 'add a new xxx' link disappears. If the user then cancel the addition,
   181         # we have to make this link appears back. This is done by giving add new link
   183         # we have to make this link appears back. This is done by giving add new link
   182         # id to removeInlineForm.
   184         # id to removeInlineForm.
   183         if card not in '?1':
   185         if card not in '?1':