Django unique_together name

class Student (models.Model): Name = models.CharField (max_length=100) Roll = models.CharField (max_length=20) Department = models.CharField (max_length=15) class Meta: unique_together = ( ('Roll', 'Department'),) It would act as a surrogate primary key column. So to make any exceptions to this behavior, you’ll have to avoid using unique_together in your model. My issue: if on 25th of Oct i have a P1 location booked from 9-17, i want it to be free for booking from 18-24. This is enforced at the database level using the unique attribute on the appropriate database columns. Using unique_together, you’re telling Django that you don’t want any two MyModel instances with the same parent and name attributes — which applies even when name is an empty string.. I am building a parking app, and my issue is that i used 4 different constraints. My