On 1/29/06, Mark Ramm <[EMAIL PROTECTED]> wrote: > Let's start with the windows weirdness. I'm using TurboGears Rev 591 > with a freshly quickstarted project. When I use the shell to make a > database update hub.commit seems to run fine, but there is no SQL > generated to actually update the database. If however I import the > database module and run database.commit_all() the database IS updated. > > I noticed however, that hub.commit seems to be using AutoConnectHub > rather than PackageHub. For example a simple hub.commit at the > tg-admin shell gives me: > > >>> hub.commit > <bound method AutoConnectHub.commit of > <turbogears.database.AutoConnectHub object at 0x012BAA50>>
I just tried this on my PowerBook, quite possibly on the same project you're using (or at least one that I know you were recently working on :). For me, hub.commit() worked fine for adding a new record. I had debug=1 on my dburi and I saw the INSERT happen, and the COMMIT happen on the same connection. If you look at "hub" in your shell, you'll find that it's a PackageHub. When you do hub.commit, you're actually talking to the AutoConnectHub that's responsible for doing the work (PackageHub has a __getattr__ that delegates to the AutoConnectHub underneath). > So, this may be related to my other problem, which is that on my > Ubuntu Laptop I can't use notrans_ to connect to a mysql database, > because it is not getting stripped off. (Ticket #346). Make sure that "hub", when displayed in the shell, is in fact a PackageHub. Just to confirm something else: you are running tg-admin shell from the top level directory of your project, right? It's worth making sure that the config that's coming through is the one that's desired. You can always run cherrypy.config.get() statements to see if sqlobject.dburi is what you'd expect. Kevin

