renamed client to instance; re-build schema/README.txt
git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@1745 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
parent
da739765d8
commit
8ec1876315
2 changed files with 13 additions and 1 deletions
|
@ -30,12 +30,22 @@ from cybertools.composer.interfaces import IInstance
|
|||
class Instance(object):
|
||||
|
||||
implements(IInstance)
|
||||
template = None
|
||||
|
||||
templateKey = 'composer.template'
|
||||
|
||||
def __init__(self, context):
|
||||
self.context = context
|
||||
self.instances = []
|
||||
|
||||
def setTemplate(self, template):
|
||||
templates = getattr(self.context, '__templates__', {})
|
||||
templates.setdefault(self.templateKey, template)
|
||||
self.context.__templates__ = templates
|
||||
def getTemplate(self):
|
||||
templates = getattr(self.context, '__templates__', {})
|
||||
return templates.get(self.templateKey, None)
|
||||
template = property(getTemplate, setTemplate)
|
||||
|
||||
def applyTemplate(self, *args, **kw):
|
||||
raise ValueError('To be implemented by subclass')
|
||||
|
||||
|
|
|
@ -29,6 +29,8 @@ from cybertools.composer.instance import Instance
|
|||
|
||||
class Editor(Instance):
|
||||
|
||||
templateKey = 'schema.editor'
|
||||
|
||||
def applyTemplate(self, data={}, *args, **kw):
|
||||
for c in self.template.components:
|
||||
# save data (if available) in context
|
||||
|
|
Loading…
Add table
Reference in a new issue