goto-switcher: reduce query data to only required attributes for speedups.
This commit is contained in:
parent
ef0dad2905
commit
f3ee9bebe7
1 changed files with 10 additions and 2 deletions
|
|
@ -113,7 +113,12 @@ class HomeView(BaseAppView, DataGridAppView):
|
|||
['repository.read', 'repository.write', 'repository.admin'],
|
||||
cache=False, name_filter=name_contains) or [-1]
|
||||
|
||||
query = Repository.query()\
|
||||
query = Session().query(
|
||||
Repository.repo_name,
|
||||
Repository.repo_id,
|
||||
Repository.repo_type,
|
||||
Repository.private,
|
||||
)\
|
||||
.filter(Repository.archived.isnot(true()))\
|
||||
.filter(or_(
|
||||
# generate multiple IN to fix limitation problems
|
||||
|
|
@ -159,7 +164,10 @@ class HomeView(BaseAppView, DataGridAppView):
|
|||
['group.read', 'group.write', 'group.admin'],
|
||||
cache=False, name_filter=name_contains) or [-1]
|
||||
|
||||
query = RepoGroup.query()\
|
||||
query = Session().query(
|
||||
RepoGroup.group_id,
|
||||
RepoGroup.group_name,
|
||||
)\
|
||||
.filter(or_(
|
||||
# generate multiple IN to fix limitation problems
|
||||
*in_filter_generator(RepoGroup.group_id, allowed_ids)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue