Closed
Description
In pre 2.3
it was possible to have a shared serializer for different models. In my case I have more or less the same invoice class for multiple entities, and had a serializer like this:
class InvoiceSerializer(serializers.ModelSerializer):
total = serializers.IntegerField(
read_only=True
)
class Meta:
model = AbstractInvoice
fields = ('number', 'end_date', 'status', 'total')
This raises an error in line 187 of field mapping.py, because AbstractInvoice does not have a _default_manager.
I could fix the error by setting the field no read-only (I have not added the POST/PUT anyway for that model).
However, it would be great if we could set that field dynamically.
Metadata
Metadata
Assignees
Labels
No labels