import web import db import config import datetime render = web.template.render('templates/', cache=config.cache) def listing(**k): l = db.listing(**k) return render.listing(l) def datestr(x): """ Can't seem to set mysql created ddl to UTC, so we'll have to adjust the datestr function to localtime which in this case is the same as the mysql server. """ return web.datestr(x, datetime.datetime.now()) web.template.Template.globals.update(dict( datestr = datestr, type = type, render = render ))