Movie add

JSONP
This commit is contained in:
Ruud
2011-03-03 13:48:31 +01:00
parent f9523444f4
commit e39de40d2d
24 changed files with 871 additions and 5029 deletions
+7 -4
View File
@@ -12,19 +12,21 @@ from sqlalchemy.orm.session import sessionmaker
from werkzeug.utils import redirect
import os
app = Flask(__name__)
log = CPLog(__name__)
app = Flask(__name__)
web = Module(__name__, 'web')
def get_session(engine):
def get_session(engine = None):
engine = engine if engine else get_engine()
return scoped_session(sessionmaker(transactional = True, bind = engine))
return scoped_session(sessionmaker(bind = engine))
def get_engine():
return create_engine(Env.get('db_path'), echo = False)
""" Web view """
@web.route('/')
@requires_auth
def index():
@@ -33,5 +35,6 @@ def index():
@app.errorhandler(404)
def page_not_found(error):
index_url = url_for('web.index')
url = request.path[len(index_url):]
url = getattr(request, 'path')[len(index_url):]
return redirect(index_url + '#' + url)