X-Git-Url: http://git.ithinksw.org/philo.git/blobdiff_plain/5a45551fd535081084355dba85642ada72b71750..01a66d144c3ac6539991c5b9f00e1bd5bab132ee:/models/fields.py diff --git a/models/fields.py b/models/fields.py index 0c31026..74a0525 100644 --- a/models/fields.py +++ b/models/fields.py @@ -129,7 +129,7 @@ class JSONAttribute(AttributeField): def value_from_object(self, obj): try: - return getattr(obj, self.attname).value + return getattr(obj, self.attname) except AttributeError: return None @@ -158,7 +158,7 @@ class ForeignKeyAttribute(AttributeField): def value_from_object(self, obj): try: - relobj = super(ForeignKeyAttribute, self).value_from_object(obj).value + relobj = super(ForeignKeyAttribute, self).value_from_object(obj) except AttributeError: return None return getattr(relobj, 'pk', None)