heywbj/django-rest-framework-recursive

'fields' attribute not being followed on ModelSerializers

boulderdave opened this issue · 3 comments

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
        }
    ]```

Typo in your ServiceSerializer? fieds instead of fields

fieds = ('id', 'name', 'parent', 'active')

(facepalm) thanks! sorry about that!

:)