'Returns the value of the field name for this instance. If the field is
a foreign key, returns the id value, instead of the object. If there\'s
no Field object with this name on the model, the model attribute\'s
value is returned directly.
Used to serialize a field\'s value (in the serializer, or form output,
for example). Normally, you would just access the attribute directly
and not use this method.'

def serializable_value(self, field_name):

    try:
        field = self._meta.get_field_by_name(field_name)[0]
    except FieldDoesNotExist:
        return getattr(self, field_name)
    return getattr(self, field.attname)
