No matter what I do i cannot post to /collections
it keeps on saying that the aggregate field products_count is required.
has anyone else been able to POST to /collections?
I get the error on POST:
“This field is required.”
Did you make products_count a read-only field in your serializer?
Here’s what I have:
model = Collection
fields = ['id', 'title', 'products_count']
products_count = serializers.IntegerField(read_only=True)
no I didnt,
that was the issue, thanks
I used like to avoid this error
products_count = serializers.IntegerField(required = False)