I have a Django web application that's similar to the typical Q&A system.
A user asks a question. other users submit answers to that question:
- Each user is allowed to submit up to N answers to each question, where N > 1 (so, say each user can submit no more than 3 answers to each question)
- A user can edit his existing answers, or submit new answer(s) if he hasn't already reached his limit.
It's straightforward to do this if each user is allowed only 1 answer - just do:
unique_together = (("user.id", "question_id"),)
But in case of N>1, what is the best way to implement this?