i have these code on my Django
def get(self, request):
movie = Movie.objects.all().order_by('name').first()
serializer = MovieSerializer(movie)
serializer_data = serializer.data
return Response(serializer_data, status=status.HTTP_200_OK)
and it returns this data
{
{
"description": "Haunted House Near You",
"id": 1,
"name": "Scary Night",
},
{
"description": "Netflix and Chill",
"id": 2,
"name": "Movie Night",
},
}
i want to add custom field , called 'alias' like this
{
{
"description": "Haunted House Near You",
"id": 1,
"name": "Scary Night",
"alias": "SN"
},
{
"description": "Netflix and Chill",
"id": 2,
"name": "Movie Night",
"alias": "MN"
},
}
My Question is, how do i add the custom field using ORM on Django?