def display(self, slug, lang = None): try: entry = meta.Session.query(m.Entry).filter( m.Entry.slug == slug ).limit(1).one() except orm.exc.NoResultFound: abort(404) if lang is None: for l in request.languages: if l in ['pl', 'pl-pl']: c.lang = 'pol' else: c.lang = 'rus' else: c.lang = str(lang) c.entry = entry return render( 'entries/display.mako', cache_expire = 3600, cache_key = repr((slug, lang)) )
def form (self): return render('entries/form.mako')