'fields' attribute not being followed on ModelSerializers
boulderdave opened this issue · 3 comments
boulderdave commented
I have a set of fields specified, yet am getting others.
Serializer:
class ServiceSerializer(recursive_serializers.ModelSerializer):
parent = RecursiveField(required=False)
class Meta:
model = Service
fieds = ('id', 'name', 'parent', 'active')
Results:
"results": [
{
"id": 18,
"parent": null,
"name": "Bankruptcy",
"active": true,
"lft": 1,
"rght": 2,
"tree_id": 2,
"level": 0
}
]```
heywbj commented
Typo in your ServiceSerializer
? fieds
instead of fields
fieds = ('id', 'name', 'parent', 'active')
boulderdave commented
(facepalm) thanks! sorry about that!
heywbj commented
:)