import wrpylib.mwmarkup
import wradmin.model as model
-from wradmin.genshi import render_genshi_template, TemplateContext
class GasthausController:
def view(self, id):
"""Displays an inn"""
q = model.meta.Session.query(model.WrInnCache)
- c = TemplateContext()
- c.inn = q.get(id)
- if c.inn is None:
+ inn = q.get(id)
+ if inn is None:
abort(404)
- return render_genshi_template('gasthaus_view.html', c=c)
+ return render_template('gasthaus_view.html', inn=inn)
def update(self):
"""Updates the wrinncache table from the wiki"""
flash('Die Gasthausliste wurde erfolgreich aktualisiert.', 'info')
except wrpylib.wrmwcache.UpdateCacheError as e:
title = str(e.args[1])
- title = wrpylib.mwmarkup.to_title(title)
+ title = wrpylib.mwmarkup.dbkey_to_title(title)
msg = str(e.args[2])
msg = msg.replace('\n', '; ')
if len(e.args) == 3: