web/views/autoform.py
changeset 10634 06a43f727601
parent 10519 0019b7888dd7
child 10637 a8b33789b982
equal deleted inserted replaced
10633:d800ecd381f6 10634:06a43f727601
   124 from warnings import warn
   124 from warnings import warn
   125 
   125 
   126 from logilab.mtconverter import xml_escape
   126 from logilab.mtconverter import xml_escape
   127 from logilab.common.decorators import iclassmethod, cached
   127 from logilab.common.decorators import iclassmethod, cached
   128 from logilab.common.deprecation import deprecated
   128 from logilab.common.deprecation import deprecated
       
   129 from logilab.common.registry import NoSelectableObject
   129 
   130 
   130 from cubicweb import neg_role, uilib
   131 from cubicweb import neg_role, uilib
   131 from cubicweb.schema import display_name
   132 from cubicweb.schema import display_name
   132 from cubicweb.view import EntityView
   133 from cubicweb.view import EntityView
   133 from cubicweb.predicates import (
   134 from cubicweb.predicates import (
   990 
   991 
   991     def inline_creation_form_view(self, rschema, ttype, role):
   992     def inline_creation_form_view(self, rschema, ttype, role):
   992         """yield inline form views to a newly related (hence created) entity
   993         """yield inline form views to a newly related (hence created) entity
   993         through the given relation
   994         through the given relation
   994         """
   995         """
   995         yield self._cw.vreg['views'].select('inline-creation', self._cw,
   996         try:
   996                                             etype=ttype, rtype=rschema, role=role,
   997             yield self._cw.vreg['views'].select('inline-creation', self._cw,
   997                                             peid=self.edited_entity.eid,
   998                                                 etype=ttype, rtype=rschema, role=role,
   998                                             petype=self.edited_entity.e_schema,
   999                                                 peid=self.edited_entity.eid,
   999                                             pform=self)
  1000                                                 petype=self.edited_entity.e_schema,
       
  1001                                                 pform=self)
       
  1002         except NoSelectableObject:
       
  1003             # may be raised if user doesn't have the permission to add ttype entities (no checked
       
  1004             # earlier) or if there is some custom selector on the view
       
  1005             pass
  1000 
  1006 
  1001 
  1007 
  1002 ## default form ui configuration ##############################################
  1008 ## default form ui configuration ##############################################
  1003 
  1009 
  1004 _AFS = uicfg.autoform_section
  1010 _AFS = uicfg.autoform_section