mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
fix: reduce the number of subqueries against User by loading eagerly the Users from PackageComaintainer
This commit is contained in:
parent
4f68532ee2
commit
a40283cdb2
1 changed files with 2 additions and 1 deletions
|
@ -2,6 +2,7 @@ from typing import Any
|
||||||
|
|
||||||
from fastapi import Request
|
from fastapi import Request
|
||||||
from sqlalchemy import and_
|
from sqlalchemy import and_
|
||||||
|
from sqlalchemy.orm import joinedload
|
||||||
|
|
||||||
from aurweb import config, db, defaults, l10n, time, util
|
from aurweb import config, db, defaults, l10n, time, util
|
||||||
from aurweb.models import PackageBase, User
|
from aurweb.models import PackageBase, User
|
||||||
|
@ -40,7 +41,7 @@ def make_context(
|
||||||
context["pkgbase"] = pkgbase
|
context["pkgbase"] = pkgbase
|
||||||
context["comaintainers"] = [
|
context["comaintainers"] = [
|
||||||
c.User
|
c.User
|
||||||
for c in pkgbase.comaintainers.order_by(
|
for c in pkgbase.comaintainers.options(joinedload(PackageComaintainer.User)).order_by(
|
||||||
PackageComaintainer.Priority.asc()
|
PackageComaintainer.Priority.asc()
|
||||||
).all()
|
).all()
|
||||||
]
|
]
|
||||||
|
|
Loading…
Add table
Reference in a new issue