From 07ef19a9467b77ec144334066f57eab535522564 Mon Sep 17 00:00:00 2001 From: helmutm Date: Mon, 7 Dec 2009 16:41:07 +0000 Subject: [PATCH] improve records field; allow explicit inclusion of fields in schema factory git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@3647 fd906abe-77d9-0310-91a1-e0d9ade77398 --- composer/schema/factory.py | 3 ++ composer/schema/grid/grid_macros.pt | 54 +++++++++++++++++++++-------- 2 files changed, 43 insertions(+), 14 deletions(-) diff --git a/composer/schema/factory.py b/composer/schema/factory.py index 8f04f06..3de488a 100644 --- a/composer/schema/factory.py +++ b/composer/schema/factory.py @@ -77,9 +77,12 @@ class SchemaFactory(object): fieldMapping = self.fieldMapping fields = [] omit = kw.pop('omit', []) + include = kw.pop('include', []) for fname in schema.getFieldNamesInOrder(interface): if fname in omit: continue + if include and fname not in include: + continue field = interface[fname] info = fieldMapping.get(field.__class__) f = createField(field, info) diff --git a/composer/schema/grid/grid_macros.pt b/composer/schema/grid/grid_macros.pt index 26031cb..903be12 100755 --- a/composer/schema/grid/grid_macros.pt +++ b/composer/schema/grid/grid_macros.pt @@ -39,30 +39,56 @@ - + tal:define="fieldInstance python: field.getFieldInstance(item.instance); + columns fieldInstance/columnTypes; + rows data/?name"> +
+ - + + + + name string:$name.$cname:records;" /> - - - -
Column Title
-
-

+ + + + + + + + + + + + +
+ +