I ran into a problem with Django’s unique_together
feature earlier. The thing is that unique_together
validates on the database level and thus the errors does not seem to be propagated to the forms validation properly.
For me that resulted in a form that was completed with no errors communicated to the user, but the data was not saved to database.
Here’s a solution for the problem, where I clean the data my self and throw an error if needed.
You can then handle the form in the view just as usual with like below.