Answer the question
In order to leave comments, you need to log in
Writes a required field, although Null is set?
In general, when adding a record to the database through the admin panel, it says that all fields must be filled in, but when creating a table, I indicated that these fields can be Null. How to fix it ?
from django.db import models
# Create your models here.
class Settings(models.Model):
date = models.CharField(max_length = 255, null = True)
is_current = models.CharField(max_length = 255, null = True)
def __str__(self):
return "{0} - {1}" . format(self.is_current, self.date)
class Meta:
verbose_name = 'Настройка'
verbose_name_plural = 'Настройки'
Settings.objects.create()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question