Skip to content

How to filter nested model #850

Answered by quroom
quroom asked this question in Q&A
Discussion options

You must be logged in to vote

I solved it by my self.
For someone who are facing same issue,
I left code.

VerseContent.objects.annotate(color=VerseHighlight.objects.filter(verse_index=OuterRef("verse_index"), user=request.user).values("color")).filter(verse_index__book_index=book_id, verse_index__chapter_index=chapter_id).values()

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by quroom
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant