2👍
✅
You can combine CreateOnlyDefault and CurrentUserDefault and define creator as read_only
with a default
value on your Serializer:
creator = serializers.HyperlinkedRelatedField(
read_only=True,
default=serializers.CreateOnlyDefault(serializers.CurrentUserDefault()),
view_name=...
)
This is my preferred way of doing this as you see directly from the Serializer definition the creator
field is treated specially.
Source:stackexchange.com