python - How to query filter in django without multiple occurrences -
I have 2 models:
Parent MODEL: 'Just' sits there
< P> ChildModel: There is a foreign key for parents ParentModel.objects.filter (childmodel__in = childmodel.objects.all ()) Many of the parents' events gives.
How do I ask all parents models who have at least one child model that is referring to it? And without many incidents ...
You almost got it right ...
ParentModeel.Obages Filter (childmodel__in = childmodel.object.all ()). Specific ()
Comments
Post a Comment