actually look for the right attribute

This commit is contained in:
Pavel Savchenko 2012-11-01 08:53:13 +02:00
parent 19bcc3c865
commit bd24d83333

View File

@ -127,7 +127,7 @@ class BaseSerializer(Field):
if key not in ret: if key not in ret:
ret[key] = val ret[key] = val
try: try:
if getattr(val.source, primary_key): if getattr(val.source, 'primary_key'):
pk_field = key pk_field = key
except AttributeError: except AttributeError:
pass pass