[Fixed]-Django filter related field

1👍

Try to use Prefetch, this will give you all profiles but plans inside it will be filtered by stard date:

plans = Plan.objects.filter(start__gte=now())
profiles = Profile.objects.prefetch_related(Prefetch('plans', queryset=plans)).all()

Leave a comment