web/views/autoform.py
changeset 4015 4f8235204dda
parent 4003 b9436fe77c9e
child 4082 c7117119e215
equal deleted inserted replaced
4014:24f7d7eb4c23 4015:4f8235204dda
    57         called.
    57         called.
    58         """
    58         """
    59         try:
    59         try:
    60             return super(AutomaticEntityForm, cls_or_self).field_by_name(name, role)
    60             return super(AutomaticEntityForm, cls_or_self).field_by_name(name, role)
    61         except form.FieldNotFound:
    61         except form.FieldNotFound:
    62             if eschema is None or not name in cls_or_self._cw.schema:
    62             if eschema is None or not name in cls_or_self._cw.vreg.schema:
    63                 raise
    63                 raise
    64             rschema = cls_or_self._cw.schema.rschema(name)
    64             rschema = cls_or_self._cw.vreg.schema.rschema(name)
    65             # XXX use a sample target type. Document this.
    65             # XXX use a sample target type. Document this.
    66             tschemas = rschema.targets(eschema, role)
    66             tschemas = rschema.targets(eschema, role)
    67             fieldcls = cls_or_self.rfields.etype_get(eschema, rschema, role,
    67             fieldcls = cls_or_self.rfields.etype_get(eschema, rschema, role,
    68                                                      tschemas[0])
    68                                                      tschemas[0])
    69             kwargs = cls_or_self.rfields_kwargs.etype_get(eschema, rschema,
    69             kwargs = cls_or_self.rfields_kwargs.etype_get(eschema, rschema,