I have this serializes
class PostSerializer(serializers.ModelSerializer):
class Meta:
model = Post
fields = ('name', 'html_code', 'order')
class PostListSerializer(serializers.ListSerializer):
child = PostSerializer()
def create(self, validated_data):
....
and I am sending this payload to create multiple entries
[
{
"name": "aaaa 2",
"order" : 3,
"html_code": "<p>test</p>"
},
{
"name": "vvffv",
"order" : 3,
"html_code": "<p>test</p>"
}
]
This works fine and entries are created.
But I have an issue when i try to view that endpoint in the *Web Browsable
Api* and i have this error
AttributeError: 'PostListSerializer' object has no attribute 'fields'
--
You received this message because you are subscribed to the Google Groups
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-rest-framework/56bfb0df-6bf3-47c2-8614-55c702ed8e68n%40googlegroups.com.