Am 14.09.2011 14:44 schrieb sk78:
I've been trying to import a predefined database in the model.py file.

I guess you want to just use the existing database scheme, not the date.

You can use the autoload feature of SQLAlchemy to get the tables:

def init_model(engine):
    DBSession.configure(bind=engine)
    global my_table
    my_table = sqlalchemy.Table('mytable', metadata,
       schema='public', autoload=True, autoload_with=engine)

And then map an empty class, or a class with some additional methods or properties, like this:

sqlalchemy.orm.mapper(MyTable, my_table)

-- Christoph

--
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.

Reply via email to