handle empty values correctly - show error info only for non-existing fields

git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@3644 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
helmutm 2009-12-04 07:07:10 +00:00
parent 6ff8ff7099
commit c88082e338

View file

@ -38,6 +38,8 @@ from cybertools.composer.instance import Instance
from cybertools.composer.interfaces import IInstance
from cybertools.util.jeep import Jeep
_not_found = object()
class DataProvider(object):
@ -98,7 +100,10 @@ class DataProvider(object):
instance = IInstance(self.getSubclient(schemaName))
instance.template = schema
data = instance.applyTemplate()
return data.get(fieldName) or '$' + key
value = data.get(fieldName, _not_found)
if value is _not_found:
return '$' + key
return value
def getSubclient(self, name):
return self.context.client