
Untitled
By: a guest on
Jul 15th, 2012 | syntax:
None | size: 1.02 KB | hits: 8 | expires: Never
def lookup(self, key, container_lookup=False):
"""
For a simple key
workitem.lookup('toto')
is equivalent to
workitem.fields['toto']
but for a complex key
workitem.lookup('toto.address')
is equivalent to
workitem.fields['toto']['address']
"""
ref=self._h['fields']
for k in key.split("."):
if not key in ref:
return None
ref = ref[key]
return ref
def lookup(self, key, container_lookup=False):
"""
For a simple key
workitem.lookup('toto')
is equivalent to
workitem.fields['toto']
but for a complex key
workitem.lookup('toto.address')
is equivalent to
workitem.fields['toto']['address']
"""
ref=self._h['fields']
for k in key.split("."):
if not k in ref:
return None
ref = ref[key]
return ref