From ec42a674d643220d509fd14889eabe38d8e1014c Mon Sep 17 00:00:00 2001 From: helmutm Date: Mon, 6 Jul 2009 09:25:01 +0000 Subject: [PATCH] bug fix: ignore show_/hide_field options on file type when exporting git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@3441 fd906abe-77d9-0310-91a1-e0d9ade77398 --- external/base.py | 2 +- schema/factory.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) 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 []