Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 13981

Model instance doesn't check fields Integrity

$
0
0

Consider the model below

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 doFaculty.objects.create()or

faculty = Faculty()faculty.save()

this creates an empty entry in the database

>>> from universities.models import *>>> Faculty.objects.create()<Faculty: Faculty object (2)>

Why doesn't Django give me an integrity error? I am using Django 5.0.


Viewing all articles
Browse latest Browse all 13981

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>