backport from bbmaster2: add field property 'visible'; add FieldGroup

This commit is contained in:
Helmut Merz 2016-10-08 14:13:33 +02:00
parent 473dd10029
commit 78969355b6
2 changed files with 10 additions and 0 deletions

View file

@ -42,10 +42,19 @@ from cybertools.composer.schema.schema import formErrors
from cybertools.util.format import toStr, toUnicode 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): class Field(Component):
implements(IField) implements(IField)
visible = True
required = False required = False
readonly = False readonly = False
nostore = False nostore = False

View file

@ -215,6 +215,7 @@ class IField(IComponent):
'(only for dropdown and other selection fields)'), '(only for dropdown and other selection fields)'),
required=False,) required=False,)
visible = Attribute('Should the field be shown in display views?')
fieldRenderer = Attribute('Name of a renderer (i.e. a ZPT macro or ' fieldRenderer = Attribute('Name of a renderer (i.e. a ZPT macro or '
'an adapter) that is responsible for rendering ' 'an adapter) that is responsible for rendering '
'(presenting) the field as a whole.') '(presenting) the field as a whole.')