Section A.7. Migrating a Project to SQLAlchemy


A.7. Migrating a Project to SQLAlchemy

Using ActiveMapper, it is not too difficult to migrate a typical project from SQL-Object to SQLAlchemy. Some transformations are required to move from SQLObject to SQLAlchemy:

  1. Database configuration in the deployment config file

  2. Identity configuration in the application config file

  3. Class definitions in your project's model.py file

  4. Calls to bySomeColumn(SomeValue) need to change to get_by(SomeColumn=SomeValue)

  5. Changes to your queries

This section is not an exhaustive guide to migrating a project to SQLAlchemy, but it should help you along the way. All the most common SQLObject features are represented. It might seem like there are many steps to go through in the coming sections, but the translation is fairly mechanical and straightforward.




Rapid Web Applications with TurboGears(c) Using Python to Create Ajax-Powered Sites
Rapid Web Applications with TurboGears: Using Python to Create Ajax-Powered Sites
ISBN: 0132433885
EAN: 2147483647
Year: 2006
Pages: 202

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net