Im my model, one of my filed are ArrayField. How can I use this field in serializer class.
class MyModel(models.Model):
arr = ArrayField(models.CharField())
class MySerializer(ModelSerializer):
class Meta:
model = MyModel
fields = ('arr')
use ListField
with child
argument
class MySerializer(ModelSerializer):
arr = serializers.ListField(child=serializers.CharField())
class Meta:
model = MyModel
fields = ('arr',)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With