provide method for controlling which macro from which template will be used for rendering

This commit is contained in:
Helmut Merz 2011-10-28 13:02:50 +02:00
parent a14c614fb3
commit 862b358254
2 changed files with 11 additions and 0 deletions

View file

@ -199,6 +199,9 @@ class FieldInstance(object):
self.errors.append(error)
self.severity = max(error.severity, self.severity)
def getRenderer(self, name):
return None
class NumberFieldInstance(FieldInstance):

View file

@ -278,6 +278,14 @@ class IFieldInstance(Interface):
allow for checking more than one data element.
"""
def getRenderer(name):
""" Return the renderer object (e.g. a ZPT macro) for this field
with the name given.
May return None in which case the calling application should
use a default renderer.
"""
class IFormState(Interface):
""" Represents the state of all fields when editing.