Reputation: 20147
I am having n- number of serializers in my current app..
i want to add one more mixin in header like ModelSerializer
into all serializer like,
class AdminSerializer(CustomMixin, serializers.ModelSerializer):
now i am applying manually.. is their a way to override to apply all together?
Upvotes: 0
Views: 607
Reputation: 3805
You could create a class that is using the mixin (give a proper name):
class MyCustomSerializer(CustomMixin, serializers.ModelSerializer):
pass
And then subclass each of the serializer from MyCustomSerializer
.
Upvotes: 1