Need to add the tables to the .select() to prevent N+1, not merely to the join
This commit is contained in:
parent
2105ad90a0
commit
729249f42b
1 changed files with 1 additions and 1 deletions
|
@ -2828,7 +2828,7 @@ def unstar_repository(user, repository):
|
||||||
def get_user_starred_repositories(user, limit=None, page=None):
|
def get_user_starred_repositories(user, limit=None, page=None):
|
||||||
""" Retrieves all of the repositories a user has starred. """
|
""" Retrieves all of the repositories a user has starred. """
|
||||||
query = (Repository
|
query = (Repository
|
||||||
.select()
|
.select(Repository, User, Visibility)
|
||||||
.join(Star)
|
.join(Star)
|
||||||
.switch(Repository)
|
.switch(Repository)
|
||||||
.join(User)
|
.join(User)
|
||||||
|
|
Reference in a new issue