'Returns the value of the object\'s attribute.'

def get_value(self, obj):

    if (self.attribute is None):
        return None
    attrs = self.attribute.split(u'__')
    value = obj
    for attr in attrs:
        try:
            value = getattr(value, attr, None)
        except (ValueError, ObjectDoesNotExist):
            return None
        if (value is None):
            return None
    if (callable(value) and (not isinstance(value, Manager))):
        value = value()
    return value
