summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNico von Geyso <Nico.Geyso@FU-Berlin.de>2012-08-16 17:50:07 +0200
committerNico von Geyso <Nico.Geyso@FU-Berlin.de>2012-08-16 17:50:07 +0200
commit2c8a7e6970ba2a8bf07a0e38ad1b7811bbadbb25 (patch)
tree11b9d7ecb9a56d5a4b91cb768fed8ed4eb93d13a
parent077b39a8bef9af1f09532f778fa445537f228bb0 (diff)
downloadklausuren-2c8a7e6970ba2a8bf07a0e38ad1b7811bbadbb25.tar.gz
klausuren-2c8a7e6970ba2a8bf07a0e38ad1b7811bbadbb25.tar.bz2
klausuren-2c8a7e6970ba2a8bf07a0e38ad1b7811bbadbb25.zip
sort years descending for module list
-rw-r--r--app.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/app.py b/app.py
index 1f39fd4..8d2a5d4 100644
--- a/app.py
+++ b/app.py
@@ -121,11 +121,13 @@ def study_show(study, oid, filename):
@app.route('/<study>/modules/<module>')
def study_index(study, module=None):
if module:
- return render_template(
- 'module_show.html', study = study, module=module, entries=fit[study].get_module(module)
- )
+ entries = sorted(fit[study].get_module(module), reverse=True)
+ return render_template('module_show.html',
+ study = study, module=module, entries=entries
+ )
- return render_template('module_list.html', study = study, modules=fit[study].get_modules())
+ modules = fit[study].get_modules()
+ return render_template('module_list.html', study = study, modules=modules)