def get_value(self, obj):
if self.attribute is None:<EOL><INDENT>return None<EOL><DEDENT>attrs = self.attribute.split('<STR_LIT>')<EOL>value = obj<EOL>for attr in attrs:<EOL><INDENT>try:<EOL><INDENT>value = getattr(value, attr, None)<EOL><DEDENT>except (ValueError, ObjectDoesNotExist):<EOL><INDENT>return None<EOL><DEDENT>if value is None:<EOL><INDENT>return None<EOL><DEDENT><DEDENT>if callable(value) and not isinstance(value, Manager):<EOL><INDENT>value = value()<EOL><DEDENT>return value<EOL>
Returns the value of the object's attribute.