I have this function in my model, but likes is actualy a many to many relashionship with User. How can I serialize it to get something like this? So that I can also get rid of the ‘likes number’ property. Answer You can use list comprehension to serialize your data, but using django rest framework’s serializer is more proper.
Tag: django-serializer
not getting fetch data from OneToOneFiled in Django Rest Framework
Models.py- In Hiring Model class Driver field is OneToOneField, how to fetch data from that, i did not find any proper solution how to work with OneToOneField relation, please help me out serializers.py views.py this is views.py render data at frontend list_edit_drivers.html- html file while ajax calling output error- while added some hiring.status column in fornt end error Answer Changes