Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hivemind
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
hivemind
Commits
cba79c7b
Commit
cba79c7b
authored
5 years ago
by
roadscape
Browse files
Options
Downloads
Patches
Plain Diff
pin feedback comm
parent
4bac995b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hive/server/hive_api/community.py
+6
-1
6 additions, 1 deletion
hive/server/hive_api/community.py
with
6 additions
and
1 deletion
hive/server/hive_api/community.py
+
6
−
1
View file @
cba79c7b
...
@@ -71,8 +71,13 @@ async def get_community_context(context, name, account):
...
@@ -71,8 +71,13 @@ async def get_community_context(context, name, account):
async
def
list_top_communities
(
context
,
limit
=
25
):
async
def
list_top_communities
(
context
,
limit
=
25
):
"""
List top communities. Returns lite community list.
"""
"""
List top communities. Returns lite community list.
"""
assert
limit
<
100
assert
limit
<
100
#sql = """SELECT name, title FROM hive_communities
# WHERE rank > 0 ORDER BY rank LIMIT :limit"""
sql
=
"""
SELECT name, title FROM hive_communities
sql
=
"""
SELECT name, title FROM hive_communities
WHERE rank > 0 ORDER BY rank LIMIT :limit
"""
WHERE id = 1344247 OR rank > 0
ORDER BY (CASE WHEN id = 1344247 THEN 0 ELSE rank END)
LIMIT :limit
"""
out
=
await
context
[
'
db
'
].
query_all
(
sql
,
limit
=
limit
)
out
=
await
context
[
'
db
'
].
query_all
(
sql
,
limit
=
limit
)
return
[(
r
[
0
],
r
[
1
])
for
r
in
out
]
return
[(
r
[
0
],
r
[
1
])
for
r
in
out
]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment