Commit 6b2033f7 by Tom Christie

Drop transform_<field_name>

parent a88a37a8
...@@ -371,14 +371,9 @@ class Serializer(BaseSerializer): ...@@ -371,14 +371,9 @@ class Serializer(BaseSerializer):
for field in fields: for field in fields:
attribute = field.get_attribute(instance) attribute = field.get_attribute(instance)
if attribute is None: if attribute is None:
value = None ret[field.field_name] = None
else: else:
value = field.to_representation(attribute) ret[field.field_name] = field.to_representation(attribute)
transform_method = getattr(self, 'transform_' + field.field_name, None)
if transform_method is not None:
value = transform_method(value)
ret[field.field_name] = value
return ret return ret
......
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