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:
parent
6ff8ff7099
commit
c88082e338
1 changed files with 6 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue