On 10/19/06, John Lavoie <[EMAIL PROTECTED]> wrote: > Can someone post a link to a good example of the > current best practices for using SA with TG?
Using SA in TG is caveat developer, it's not officially supported, so there isn't much in the way of docs. The current thinking on SA is on the docs wiki[1]. All other docs are most likely out of date and incorrect. This holds for most other types of docs. I'm working to ensure that everything on docs.turbogears.org is correct for 1.0, but I'm not 100% sure that everybody is checking the validity of the docs they're converting. [1] http://docs.turbogears.org/1.0/SQLAlchemy > A few of the issues I ran into: > -My goal with TG is to write a new front-end to existing databases. > autoload=True is a requirement. > -My tables have string columns, but TG tries to write unicode data into > them. I had to add extra str()'s every time I'm sending something to > the database. All my development has been strictly EN-us, so ignorance is bliss. I'm pretty sure SA works in unicode internally and the default output encoding is utf-8. You can try setting the encoding option when creating your engine or creating a custom type that does the str() wrapping. > -Is there any way to auto save/commit? All of the SA docs I have seen > say that I need to force it with session.save and session.flush TG has had automatic transactions in SA for months. Don't believe what you read on the trac wiki. > -As my database is already defined, I don't see any advantages to > ActiveMapper. Am I wrong? I prefer not using activemapper in general. It doesn't really have a maintainer and doesn't support some of the more advanced relation options, namely primaryjoin/secondaryjoin. Others seem to have no problems with it. I use the assign_mapper method mentioned on the wiki. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

