On Wednesday, December 01, 2010 16:58:09 Michael Semcheski wrote: > Hello, > > I'd like to write a simple python script to open up the database from > production.ini and the database from development.ini and move all of > my database objects from one to the other. I'm planning on doing this > only from the command line, not via a web application. This will be > part of the script I run to move things from development to > production. (But sometimes I need to move things from the production > database to the development database, which complicates the matter.) > > It doesn't seem like that difficult a task, except that I can't see a > good way to get the connection string values from the configuration > files. Is there a good way to do this that I'm missing?
Just use the module ConfigParser. > > The other way to do this might be to write a script that creates > database fixtures from the existing data model and saves them to a > file. I can see that having some advantages. Is this something that > has already been covered by another tool I should know about? I don't understand this. There is sql-migrate, a SA-migration framework. I haven't really used it (we eventually cooked up our own solution), but it might be worth a try. Because I think your approach is somewhat difficult. Sharing objects between sessions/connections is not that easy I fear. You might run into all kinds of problems. I'd go for "plainer" SQL. Diez -- 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.

