Uprank myself temporarily to make the first subnode in [[agora]] a
better welcome to some visitors.
This commit is contained in:
parent
a95b5d8d0b
commit
11d57c0a81
2 changed files with 13 additions and 2 deletions
|
@ -109,6 +109,8 @@ def pull(node):
|
|||
def wikilink(node):
|
||||
|
||||
n = G.node(node)
|
||||
n.subnodes = util.uprank(n.subnodes, user='flancian')
|
||||
|
||||
return render_template(
|
||||
'node_rendered.html',
|
||||
node=n,
|
||||
|
|
13
app/util.py
13
app/util.py
|
@ -17,9 +17,18 @@ from functools import lru_cache
|
|||
|
||||
parser = DateDataParser(languages=['en'])
|
||||
|
||||
def rank(l, user):
|
||||
def rank(l, attribute):
|
||||
# hack hack
|
||||
return sorted(l, key=lambda x: x.user)
|
||||
return sorted(l, key=lambda x: x.attribute)
|
||||
|
||||
def uprank(l, user):
|
||||
# hack hack
|
||||
def score(n):
|
||||
if n.user == user:
|
||||
return -1
|
||||
return 0
|
||||
|
||||
return sorted(l, key=score)
|
||||
|
||||
def canonical_wikilink(wikilink):
|
||||
|
||||
|
|
Loading…
Reference in a new issue