I’ve tried something like this, it does not work. class PostSerializer(serializers.ModelSerializer): class Meta: model = Post def save(self): user = self.context...
I am using django-rest-framework. It provides an awesome Django admin style browsable self-documenting API. But anyone can visit those pages and use the ...
-
June 2, 2022
- 0 Comments
I want to serialize a model, but want to include an additional field that requires doing some database lookups on the model instance ...
-
June 1, 2022
- 0 Comments
I would like to provide two different serializers and yet be able to benefit from all the facilities of ModelViewSet: When viewing a ...
-
May 20, 2022
- 0 Comments