web/views/autoform.py
branchstable
changeset 2096 58c485797b03
parent 2005 e8032965f37a
child 2143 d4c2fb633062
equal deleted inserted replaced
2095:897732d3ee5a 2096:58c485797b03
   135             if eschema is None or not name in cls_or_self.schema:
   135             if eschema is None or not name in cls_or_self.schema:
   136                 raise
   136                 raise
   137             rschema = cls_or_self.schema.rschema(name)
   137             rschema = cls_or_self.schema.rschema(name)
   138             # XXX use a sample target type. Document this.
   138             # XXX use a sample target type. Document this.
   139             tschemas = rschema.targets(eschema, role)
   139             tschemas = rschema.targets(eschema, role)
   140             fieldcls = cls_or_self.rfields.etype_get(eschema, rschema, role, tschemas[0])
   140             fieldcls = cls_or_self.rfields.etype_get(eschema, rschema, role,
   141             kwargs = cls_or_self.rfields_kwargs.etype_get(eschema, rschema, role, tschemas[0])
   141                                                      tschemas[0])
       
   142             kwargs = cls_or_self.rfields_kwargs.etype_get(eschema, rschema,
       
   143                                                           role, tschemas[0])
   142             if kwargs is None:
   144             if kwargs is None:
   143                 kwargs = {}
   145                 kwargs = {}
   144             if fieldcls:
   146             if fieldcls:
   145                 if not isinstance(fieldcls, type):
   147                 if not isinstance(fieldcls, type):
   146                     return fieldcls # already and instance
   148                     return fieldcls # already and instance