Skip to content

Is limiting relationships possible? #67

Answered by j4mie
adammsteele asked this question in Q&A
Discussion options

You must be logged in to vote

Hi! Thanks for trying out django-readers 😎

I think the question isn't really readers-specific: readers just uses prefetch_related to load relationships, so what you need to be able to do is prefetch a limited number of objects. This article suggests a few ways to do it, involving OuterRef and Subquery. If you can get this to work with "just" your queryset (ie without readers) then it should be fairly straightforward to convert this into a reader pair.

I'll leave this ticket open because I'm very interested to hear how you get on!

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by j4mie
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #58 on July 15, 2022 10:19.