审议以下模式
class Faculty(models.Model):
name = models.CharField(max_length=255)
short_name = models.CharField(max_length=15)
description = models.CharField(max_length=512)
logo = models.ImageField(upload_to=faculty_upload_to, null=True)
That I do
Faculty.objects.create()
Or
faculty = Faculty()
faculty.save()
这就造成了数据库中的空档。
>>> from universities.models import *
>>> Faculty.objects.create()
<Faculty: Faculty object (2)>
why django doesn t give me an integrity error. I use django 5.0