Commit d1746e2f by Tom Christie

Allow callables in dotted notation like Field(source='foo.bar')

parent 0c65d9ba
......@@ -70,6 +70,8 @@ class Field(object):
value = obj
for component in self.source.split('.'):
value = getattr(value, component)
if is_simple_callable(value):
value = value()
else:
value = getattr(obj, field_name)
return self.to_native(value)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment