diff options
author | René 'Necoro' Neumann <necoro@necoro.net> | 2010-05-03 23:11:52 +0200 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.net> | 2010-05-03 23:11:52 +0200 |
commit | 81e7480e7526025ce27f0ca234104b039631cf3d (patch) | |
tree | 3e75d4728e1c378e51c23f09ae842f3c6c585e98 /index.py | |
parent | f0012811f8af8b1334b46781861a6dd3777ee392 (diff) | |
download | kosten-81e7480e7526025ce27f0ca234104b039631cf3d.tar.gz kosten-81e7480e7526025ce27f0ca234104b039631cf3d.tar.bz2 kosten-81e7480e7526025ce27f0ca234104b039631cf3d.zip |
started modelling
Diffstat (limited to '')
-rwxr-xr-x | index.py | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -2,6 +2,7 @@ import web import controller +import model # # URL Mappings @@ -12,11 +13,31 @@ urls = ( ) # +# ORM +# +def handle_sql(handler): + web.ctx.orm = session = model.session + + try: + return handler() + except web.HTTPError: + session.commit() + raise + except: + session.rollback() + raise + else: + session.commit() + +# # The App # app = web.application(urls, globals()) app.notfound = controller.FourOhFour +# add orm processor +app.add_processor(handle_sql) + # debug for the moment web.config.debug = True |