Rest Framework Django - Disable field to accept null values
How can I configure for the serialized Model to accept blank fields?
Warning
{"Operacao": ["This field can not be blank."]}
Model
class SEF(models.Model):
operacao = models.CharField(max_length=10, null=True)
documento = models.CharField(max_length=50, null=True)
user = models.ForeignKey(User)
Serializer
class SEFCreateSerializer(serializers.ModelSerializer):
class Meta:
model = SEF
fields = ('operacao', 'documento', 'user')
View
sef_create = SEFCreateSerializer(data=data, many=True)
if sef_create.is_valid():
sef_create.save()
salvo = HTTP_200_OK
else:
salvo = sef_create.errors