Django Rest Framework post primary key uuid or autogenerate
问题 The following link helped me a lot reference So, by using id = serializers.UUIDField() makes passing an ID required. It will no longer autogenerate if on is missing. I assume at this point that on any serializer I want to be able to POST an id, I need to override the Create method and if no ID is passed in the post data, generate a new uuid there and save the model. Is this correct? OR Is there a way DRF can both allow for and id to be passed in or autogenerate if it is not? EDIT: I tried