diff --git a/external/base.py b/external/base.py index eb8d3d4..302638f 100644 --- a/external/base.py +++ b/external/base.py @@ -188,7 +188,7 @@ class Extractor(Base): aObj = adapted(obj) schemaFactory = component.getAdapter(aObj, ISchemaFactory) ti = IType(obj).typeInterface or defaultInterface - schema = schemaFactory(ti, manager=self) #, request=self.request) + schema = schemaFactory(ti, manager=self, mode='export') #, request=self.request) instance = IInstance(aObj) instance.template = schema # TODO: this should also convert object attributes like e.g. typeInterface diff --git a/schema/factory.py b/schema/factory.py index e159446..3a8888e 100644 --- a/schema/factory.py +++ b/schema/factory.py @@ -50,6 +50,8 @@ class FileSchemaFactory(SchemaFactory): def __call__(self, interface, **kw): schema = super(FileSchemaFactory, self).__call__(interface, **kw) + if kw.get('mode') == 'export': + return schema options = IOptions(self.context.type) hide = options('hide_fields') or [] show = options('show_fields') or []