[Django]-Accepting a different field in POST in Django REST Framework

4👍

There is to_internal_value function read more on Docs:

Override this to support deserialization, for write operations.

You can override it like this:

def to_internal_value(self, data):
    if data.get('attribute_value'):
        data['value'] = data.pop('attribute_value')
    data = super().to_internal_value(data)
    return data

Leave a comment