evenicoulddoit / django-rest-framework-serializer-extensions

Extensions to help DRY up Django Rest Framework serializers
Other
247 stars 23 forks source link

It's not working #47

Closed Mng-dev-ai closed 3 years ago

Mng-dev-ai commented 3 years ago

I'm trying to expand location but it seems that it doesn't work it just adding the location_id in fields but when I add ?expand=location in the url nothing happens

Code :

class VehicleSerializer(SerializerExtensionsMixin,serializers.ModelSerializer):
    class Meta:
        model = Vehicle
        exclude = ('location',)
        expandable_fields = dict(
         location = LocationSerializer
        )