On 5/23/07, voltron <[EMAIL PROTECTED]> wrote: > > What is the recommend usage of SQLAlchemy and Pylons? I found these > links, what is preffered?
See my message yesterday, subject "SQLAlchemy model". The steps are clear: you need an engine, metadata, and tables (explicitly defined or autoloaded), and if you're using the ORM you also need a session context and mapped classes. But the ideal way to configure this has not yet been determined. > http://docs.pythonweb.org/display/pylonscookbook/SQLAlchemy+for+people+in+a+hurry Use this one. The way to set up the model is still evolving, but this is the closest to the emerging standard. If you need to autoload tables, try putting metadata.connect(session_context.current.bind_to) before your table definitions. See my message yesterday, subject "SQLAlchemy model". Ignore the part about DynamicMetaData not working. The reason it works is the assign_mapper extension is apparently connecting the metadata whenever it uses it. > http://www.rexx.com/~dkuhlman/pylons_quick_site.html#database-access-using-a-data-model This looks like an older approach from the days when pylons.database didn't have SQLAlchemy support. I'd say it's more cumbersome, and it's certainly strange to have an externally-called init function that initializes module globals. > http://www.sqlalchemy.org/docs/tutorial.html#tutorial_orm It's still the same steps, it's that pylons.database does some of it for you. -- Mike Orr <[EMAIL PROTECTED]> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pylons-discuss" 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/pylons-discuss?hl=en -~----------~----~----~----~------~----~------~--~---
