diff --git a/composer/schema/browser/common.py b/composer/schema/browser/common.py index 8b36c0f..456cbac 100644 --- a/composer/schema/browser/common.py +++ b/composer/schema/browser/common.py @@ -23,6 +23,7 @@ $Id$ """ from zope import component +from zope.app.pagetemplate import ViewPageTemplateFile from zope.app.session.interfaces import ISession from zope.cachedescriptors.property import Lazy @@ -30,10 +31,18 @@ from cybertools.composer.interfaces import IInstance from cybertools.composer.schema.interfaces import IClientFactory +schema_macros = ViewPageTemplateFile('schema_macros.pt') +schema_edit_macros = schema_macros # default: no editing + packageId = 'cybertools.composer.schema' class BaseView(object): + """ Base class for views that have schema objects as their context. + + Do not use this base class for views on typical content objects + that are not schemas! + """ clientName = None diff --git a/composer/schema/browser/schema_macros.pt b/composer/schema/browser/schema_macros.pt new file mode 100755 index 0000000..a3d8b4f --- /dev/null +++ b/composer/schema/browser/schema_macros.pt @@ -0,0 +1,123 @@ + + + + + + + + + + + + +
+ + + +
+
+ + + + + + + ??? + + + + + + ... + * + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +   + + + +
+
+ + + + + + + + + + +
+ + + + diff --git a/composer/schema/field.py b/composer/schema/field.py index 95a8740..2e18d31 100644 --- a/composer/schema/field.py +++ b/composer/schema/field.py @@ -40,6 +40,7 @@ class Field(Component): required = False standardFieldName = None vocabulary = None + defaultValue = None renderFactory = None def __init__(self, name, title=None, fieldType='textline', **kw): @@ -63,7 +64,9 @@ class Field(Component): voc = (self.vocabulary or '') if isinstance(voc, basestring): voc = voc.splitlines() - return [dict(token=v, title=v) for v in voc if v.strip()] + return [dict(token=t, title=t) for t in voc if t.strip()] + else: + return [dict(token=t.token, title=t.title) for t in voc] def getFieldTypeInfo(self): return fieldTypes.getTerm(self.fieldType)