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.
Source:stackexchange.com