Currently I'm trying to develop personal blog with Django/REST API, and I have trouble for that.
There are a number of posts in blog and I want to control those posts with Hyperlink. I made it by using ModelViewSet, however, whole data in detailView is also shown in ListView.
The thing is, I only want "url" and "title" of posts to be shown in ListView while DetailView contains full data. Here is my code and current results given by REST framework.
# serializers
# views
# Post List in REST API
# Post instance in REST API
Aucun commentaire:
Enregistrer un commentaire