[Answered ]-Django Query input results of one queryset to find an object that doesn't appear in another model

1👍

You can obtain this with:

Hint.objects.filter(gameactivity=None, chapter_id=my_chapter_id).order_by(
    'hint_level'
).first()

this will return a Hint not referred to by any GameActivity for a given capter_id, and with the lowest hint_level. If there is no such item, None is returned.

Leave a comment