I have three models like the following and have a list of Boys. How can I get a list of each of their sisters? Unfortunately I can not use prefetch related as I am stuck using a very old version of django.
class Parent(model.Model):
name = models.CharField(max_length=50)
class Boy(model.Model):
parent = models.ForeignKey(Parent)
name = models.CharField(max_length=50)
class Girl(model.Model):
parent = models.ForeignKey(Parent)
name = models.CharField(max_length=50)
Desired output would be something like this:
{ boy1: [ sister1, sister2 ], boy2: [ .. ] }
Thanks in advance for any help!