web/views/editforms.py
changeset 2789 39712da6f397
parent 2686 c700ace6ebfd
child 2890 fdcb8a2bb6eb
equal deleted inserted replaced
2788:8d3dbe577d3a 2789:39712da6f397
   160         """display field to edit entity's `rtype` relation on click"""
   160         """display field to edit entity's `rtype` relation on click"""
   161         assert rtype
   161         assert rtype
   162         assert role in ('subject', 'object')
   162         assert role in ('subject', 'object')
   163         if default is None:
   163         if default is None:
   164             default = xml_escape(self.req._('<no value>'))
   164             default = xml_escape(self.req._('<no value>'))
   165         entity = self.entity(row, col)
   165         entity = self.rset.get_entity(row, col)
   166         rschema = entity.schema.rschema(rtype)
   166         rschema = entity.schema.rschema(rtype)
   167         lzone = self._build_landing_zone(landing_zone)
   167         lzone = self._build_landing_zone(landing_zone)
   168         # compute value, checking perms, build form
   168         # compute value, checking perms, build form
   169         if rschema.is_final():
   169         if rschema.is_final():
   170             onsubmit = ("return inlineValidateAttributeForm('%(rtype)s', '%(eid)s', '%(divid)s', "
   170             onsubmit = ("return inlineValidateAttributeForm('%(rtype)s', '%(eid)s', '%(divid)s', "
   455         """
   455         """
   456         :param peid: the parent entity's eid hosting the inline form
   456         :param peid: the parent entity's eid hosting the inline form
   457         :param rtype: the relation bridging `etype` and `peid`
   457         :param rtype: the relation bridging `etype` and `peid`
   458         :param role: the role played by the `peid` in the relation
   458         :param role: the role played by the `peid` in the relation
   459         """
   459         """
   460         entity = self.entity(row, col)
   460         entity = self.rset.get_entity(row, col)
   461         divonclick = "restoreInlinedEntity('%s', '%s', '%s')" % (peid, rtype,
   461         divonclick = "restoreInlinedEntity('%s', '%s', '%s')" % (peid, rtype,
   462                                                                  entity.eid)
   462                                                                  entity.eid)
   463         self.render_form(entity, peid, rtype, role, divonclick=divonclick)
   463         self.render_form(entity, peid, rtype, role, divonclick=divonclick)
   464 
   464 
   465     def render_form(self, entity, peid, rtype, role, **kwargs):
   465     def render_form(self, entity, peid, rtype, role, **kwargs):