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
This commit is contained in:
helmutm 2009-07-06 09:25:01 +00:00
parent 5518ad648a
commit ec42a674d6
2 changed files with 3 additions and 1 deletions

2
external/base.py vendored
View file

@ -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

View file

@ -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 []