Kevin Dangoor wrote: > Hi Joe, > > On Sep 5, 2006, at 11:52 PM, Joe wrote: > > >> tg-admin sql create -c dev.cfg > > > Hmm, you shouldn't need to specify -c dev.cfg if you're in the right > directory. > If you reread my original post, you'll notice that in point 3 I mentioned that if I excluded the -c option, I got an error because tg-admin would look at prod.cfg. When I issued the command I was in the first wiki20 directory (where the wiki20-start.py is located) and the quickstart command created both prod.cfg and dev.cfg. How does it know whether to use one or the other? It looked to me (without examining the code) as if it defaulted to prod.cfg.
Strangely enough, I just reexecuted the same "tg-admin sql create" command I had invoked initially, i.e., without the -c dev.cfg, and wonder of wonders, it worked, completely! Examining the PostgreSQL database showed the 'page' table had been created, as well as the associated sequence. My only explanation for the sudden "change of heart" is that I rebooted the machine overnight (and I also installed psycopg1) and whatever was wrong got fixed (but now we can only speculate as to what that was). > > I traced the execution path and it seems that TG command/__init__ > > tacks > > on the dburi with a -c to the argv passed to sqlobject.manager's > > command. Then apparently CommandCreate() calls the standard_parser() > > which adds it to self.options.connection_uri. So, as you said > > everything ought to work. > > Actually, that doesn't sound right at all. The dburi needs to come > from the config file, but it shouldn't come directly from the -c > command line option. > I think you may be confusing the -c option given to the tg-admin command above with my description of what the code in command/__init__.py does. After reading the .cfg file it creates a "command line" to pass to sqlobject.manager. In that context, the -c is short for --connection and the dburi is passed as argument to that option. Thanks for your help. Joe --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

