-
-
Notifications
You must be signed in to change notification settings - Fork 549
Open
Description
Is your feature request related to a problem? Please describe.
When blank=True is specified at a Djang Field, ModelSchema treats the field as nullable even if null=False is also specified there. So, ModelSchema passes null to the Django model and it raise NOT NULL constraint exception.
class CharFieldVerification(models.Model):
char_field = models.CharField(max_length=200, blank=True, null=False)
class TextFieldVerification(models.Model):
text_field = models.TextField(blank=True, null=False)
class DateFieldVerification(models.Model):
date_field = models.DateField(blank=True, null=False)
class FileFieldVerification(models.Model):
file_field = models.FileField(blank=True, null=False)
class BooleanFieldVerification(models.Model):
boolean_field = models.BooleanField(blank=True, null=False)
The combination of blank=True and null=False seems to be common in string-based Django fields, which is mentioned in Django Model field reference
Other related Issue
uptickmetachu
Metadata
Metadata
Assignees
Labels
No labels
