This is the current return from API
"detail": {
"id": 2,
"nickname": "Vlad",
"creation_date": 1713985234337,
"is_superuser": true,
"is_staff": true,
"is_active": true,
"profile_image": "/media/profile_images/eu.jpg",
"posts": [
51,
52,
58,
61,
62,
69,
89
]
},
"status": 200
}```
What i want to achieve is
```{
"detail": {
"id": 2,
"nickname": "Vlad",
"creation_date": 1713985234337,
"is_superuser": true,
"is_staff": true,
"is_active": true,
"profile_image": "/media/profile_images/eu.jpg",
"posts": [
{
title: "ABC"
},
]
},
"status": 200
}```
`serializer.py`
```from rest_framework import serializers
from .models import NewUser
from heyllux.models import Post
# from heyllux.serializer import PostSerializer
class UserSerializer(serializers.ModelSerializer):
posts = serializers.PrimaryKeyRelatedField(many=True, queryset=Post.objects.all())
class Meta:
model = NewUser
fields = ['id','nickname', 'creation_date', 'is_superuser', 'is_staff', 'is_active', 'profile_image', 'posts']
```