Closed oliverbienert closed 7 years ago
My fault, sorry. It was quite late last night, shouldn't work that hours ;-)
Forgot to set read_only=True
on the serializer field:
id = HashidSerializerCharField(source_field='api.project.id', read_only=True)
Hi, in Django Rest Framework, I normally don't have to declare id fields explicitly. When I post data, a new instance is created. Sadly, this does not work if I make my model id a HashidAutoField:
In the ModelSerializer, I have to declare id explicitly as well:
When I now send a post, the server responds with an ApiError:
Naturally I would not send an id, for it is a post message, intended to create a new object. And I need the id to automatically created by the database, as usual. How is this supposed to work?