From 78969355b661c1acd9dabc3c47063e2d30e46711 Mon Sep 17 00:00:00 2001 From: Helmut Merz Date: Sat, 8 Oct 2016 14:13:33 +0200 Subject: [PATCH] backport from bbmaster2: add field property 'visible'; add FieldGroup --- composer/schema/field.py | 9 +++++++++ composer/schema/interfaces.py | 1 + 2 files changed, 10 insertions(+) diff --git a/composer/schema/field.py b/composer/schema/field.py index 16e5427..89c7320 100644 --- a/composer/schema/field.py +++ b/composer/schema/field.py @@ -42,10 +42,19 @@ from cybertools.composer.schema.schema import formErrors from cybertools.util.format import toStr, toUnicode +class FieldGroup(object): + + def __init__(self, name, label, sublabels=[]): + self.name = name + self.label = label + self.sublabels = sublabels + + class Field(Component): implements(IField) + visible = True required = False readonly = False nostore = False diff --git a/composer/schema/interfaces.py b/composer/schema/interfaces.py index a9648fd..ebc4825 100644 --- a/composer/schema/interfaces.py +++ b/composer/schema/interfaces.py @@ -215,6 +215,7 @@ class IField(IComponent): '(only for dropdown and other selection fields)'), required=False,) + visible = Attribute('Should the field be shown in display views?') fieldRenderer = Attribute('Name of a renderer (i.e. a ZPT macro or ' 'an adapter) that is responsible for rendering ' '(presenting) the field as a whole.')