Created
June 26, 2010 12:52
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
An example to show how to use turbogears sqlalchemy session and model | |
outside of turbogears. | |
""" | |
from fileupload.model import DBSession, metadata, init_model | |
from fileupload.model.userfile import UserFile | |
from sqlalchemy import create_engine, sql | |
engine = create_engine("sqlite:////home/mengu/projects/turbogears/fileupload/devdata.db") | |
init_model(engine) | |
result = DBSession.query(UserFile).all() | |
print result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
that "sql" import is not needed :)