We have a modelViewset:
class ObjectViewSet(viewsets.ModelViewSet):
serializer_class = MyObjectSerializer
def perform_create(self, serializer):
...
def perform_update(self, serializer):
...
def perform_destroy(self, instance):
...
But perform_create doesn't return the newly created object which means the 201 response only contains a few random fields that were specified during creation and not the whole new object.
Is there some special way to get the object without overriding the .create() call? It seems like returning the new object is expected behavior, so I'm worried I'm doing something wrong here.