This is a topic I’ve seen on a regular basis and spoke about in a few meetups. I think it’s now time to have something written about.
One question I’ve seen on a regular basis is “With Django REST framework, how do I restrict my related data choices according to some criteria” ?
This question comes pretty often on Stackoverflow /IRC / mailing list.
The issue is when one uses nested serializers while the nested model has a unique constraint. Here’s a Task model that has a foreign key to…
Task