Re: Newbie Q: modifying SQL statements

2008-01-11 Thread Faber J. Fedor
On 12/01/08 00:23 +0100, Hrvoje Niksic wrote: > "Faber J. Fedor" <[EMAIL PROTECTED]> writes: > > Does this '("" if not where...' syntax actually work? > > http://docs.python.org/whatsnew/pep-308.html C'mon! I'm in Day Two of learning Python. You can't expect me to be reading "What's New" docs a

Re: Newbie Q: modifying SQL statements

2008-01-11 Thread Faber J. Fedor
On 11/01/08 18:29 -0500, Mike Meyer wrote: > It is a 2.5 feature, though. I was beginning to wonder of that was the case. > I converted all my clients to 2.5.1, > shortly after it was available, and haven't used anything older > since. Sorry 'bout that. No prob. -- Regards, Faber Fedor

Re: Newbie Q: modifying SQL statements

2008-01-11 Thread Hrvoje Niksic
"Faber J. Fedor" <[EMAIL PROTECTED]> writes: > On 10/01/08 22:53 -0500, Mike Meyer wrote: >> Personally, I think it would be more pythonic to not try and use two >> different APIs to walk the list of jobs (... One Way To Do it): >> >> def __call__(self, where=None): >> q = "select * from %s"

Re: Newbie Q: modifying SQL statements

2008-01-11 Thread Mike Meyer
On Fri, 11 Jan 2008 18:11:41 -0500 "Faber J. Fedor" <[EMAIL PROTECTED]> wrote: > On 10/01/08 22:53 -0500, Mike Meyer wrote: > > Personally, I think it would be more pythonic to not try and use two > > different APIs to walk the list of jobs (... One Way To Do it): > > > > def __call__(self, where

Re: Newbie Q: modifying SQL statements

2008-01-11 Thread Faber J. Fedor
On 10/01/08 22:53 -0500, Mike Meyer wrote: > Personally, I think it would be more pythonic to not try and use two > different APIs to walk the list of jobs (... One Way To Do it): > > def __call__(self, where=None): > q = "select * from %s" % (self.name,) + ("" if not where else (" where > %s

Re: Newbie Q: modifying SQL statements

2008-01-10 Thread Mike Meyer
On Thu, 10 Jan 2008 20:32:06 -0500 "Faber J. Fedor" <[EMAIL PROTECTED]> wrote: > Hi all, > > I'm in the process of learning Python by writing a job queue program. > Nothing fancy, mind you, just read from a table, shell out to a program, > write back to the table. > > I'm working off of the tuto

Newbie Q: modifying SQL statements

2008-01-10 Thread Faber J. Fedor
Hi all, I'm in the process of learning Python by writing a job queue program. Nothing fancy, mind you, just read from a table, shell out to a program, write back to the table. I'm working off of the tutorial listed here (amongst many places): http://www.devx.com/dbzone/Article/22093 In my Jobs c