Let's say I have a model Class Parent and a Class Child. And child has a field called status and a ForeignKey relationship to Parent.
Let's say I retrieve one parent by calling filter (so as to have a QuerySet) by calling p = Parent.objects.filter(pk=1)
Now if I call p.values('children__name') I will receive a list of dictionaries of the children names to that parent.
My question is, if I wanted to call p.values('children__name') but limit the values only if the status of the child was specific, how would I do that?
I also want to make sure the original QuerySet is unaltered, as I don't want to filter it down (for larger QuerySets). I just want to filter the values that are based on some parameter.
Is there any way to do this in Django?