Is there a way to specify a Model in Django such that is ensures that pair of fields in unique in the table, in a way similar to the ‘unique=True’ attribute for similar field?
Or do I need to check this constraint in the clean() method?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There is a META option called
unique_together. For example:More info on the Django documentation page.