Django's ModelForm unique_together validation
I have a Django model that looks like this. class Solution(models.Model): ''' Represents a solution to a specific problem. ''' name = models.CharField(max_length=50) problem = models.ForeignKey(Problem) description = models.TextField(blank=True) date = models.DateTimeField(auto_now_add=True) class Meta: unique_together = ("name", "problem") I use a form for adding models that looks like this: class SolutionForm(forms.ModelForm): class Meta: model = Solution exclude = ['problem'] My problem is that the SolutionForm does not validate Solution 's unique_together constraint and thus, it returns an