Django’s ModelForm unique_together validation

I solved this same problem by overriding the validate_unique() method of the ModelForm: def validate_unique(self): exclude = self._get_validation_exclusions() exclude.remove(‘problem’) # allow checking against the missing attribute try: self.instance.validate_unique(exclude=exclude) except ValidationError, e: self._update_errors(e.message_dict) Now I just always make sure that the attribute not provided on the form is still available, e.g. instance=Solution(problem=some_problem) on the initializer.

How to get Interdependent dropdowns in django using Modelform and jquery?

You might need to use the following technologies: Custom Django Form Fields (Within the model form) ajax(to fetch the records) simplejson(to send a json response to ajax) jquery(to update the combo boxes on client side) Let’s have a look at an example(Not really tested this, just from the top of my mind): Models.py from django.db … Read more