From 32fd82ba0d6082418e5ca5633f9e9709bd44e86b Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Thu, 16 Oct 2014 20:45:36 +0100 Subject: get_attribute method on fields --- rest_framework/fields.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'rest_framework/fields.py') diff --git a/rest_framework/fields.py b/rest_framework/fields.py index 24dfaaf5..597d5e12 100644 --- a/rest_framework/fields.py +++ b/rest_framework/fields.py @@ -212,15 +212,12 @@ class Field(object): return self.default_empty_html if (ret == '') else ret return dictionary.get(self.field_name, empty) - def get_field_representation(self, instance): + def get_attribute(self, instance): """ - Given the outgoing object instance, return the primitive value + Given the *outgoing* object instance, return the primitive value that should be used for this field. """ - attribute = get_attribute(instance, self.source_attrs) - if attribute is None: - return None - return self.to_representation(attribute) + return get_attribute(instance, self.source_attrs) def get_default(self): """ -- cgit v1.2.3