Twitch Dev Tracker

(2020) Nested serializers: Server Error 500

This thread was added on May 19, 2020, with posts from itmightbedave.

Original Post

class RacuniizlaznifinancijskiSerializers(serializers.ModelSerializer):
    pp = PoslovnipartneriSerializers(many=True, read_only=True)
class Meta:
        model = Racuniizlaznifinancijski
        fields = ["__all__", "pp"]

I want all fields from Racuniizlaznifinancijski and also all fields from Poslovnipartneri...

What is wrong here?

You just needs fields = ['__all__']. If you want all fields in the nested serializer, you need to set it on that object.