On Thu, Apr 20, 2006 at 02:33:05PM -0500, Luke Opperman wrote:
> __sqlrepr__ it appears it is using
>
> things = self.items[:]
>
> changing that to
>
> things = list(self.items)
>
> should make it work.
Done. Thank you for the advice!
Oleg.
--
Oleg Broytmannhttp://phd.pp.
On Fri, Apr 21, 2006 at 01:01:51AM +0400, Oleg Broytmann wrote:
> On Thu, Apr 20, 2006 at 02:39:48PM -0600, Gabe Rudy wrote:
> > connection.sqlrepr(Select(...)) is preferred over str(Select(...)) then is
> > it?
>
>str(Select()) can raise an exception because str() doesn't pass a
> database n
On Thu, Apr 20, 2006 at 02:39:48PM -0600, Gabe Rudy wrote:
> connection.sqlrepr(Select(...)) is preferred over str(Select(...)) then is it?
str(Select()) can raise an exception because str() doesn't pass a
database name to __sqlrepr__() internal methods. connection.sqlrepr()
passes it correctly
Cool, there is no special reason why I need to use tuples, so I'm just glad I
got something to work.
connection.sqlrepr(Select(...)) is preferred over str(Select(...)) then is it?
Thanks for that quick response on my question Oleg, I actually did'nt get
yours untill after I responded to my own
sqlbuilder.Select looks like it's supposed to handle lists or tuples (although
yes, by type-checking). And then in __sqlrepr__ it appears it is using
things = self.items[:]
Presumably this is intended a) to make a copy so that appending to things
doesn't update self.items and b) to cast to a lis
> >str(Select((Contact.q.id, Contact.q.firstName, Company.q.companyName),
> Contact.q.companyID == Company.q.id))
> File "", line 1, in ?
> ...
> "/usr/lib/python2.4/site-packages/SQLObject-0.8dev_r1706-py2.4.egg/sqlobjec
>t/sqlbuilder.py", line 452, in __sqlrepr__
> things.append(self.whereC
On Thu, Apr 20, 2006 at 12:44:39PM -0600, Gabe Rudy wrote:
> >str(Select((Contact.q.id, Contact.q.firstName, Company.q.companyName),
> AttributeError: 'tuple' object has no attribute 'append'
The first arg should be a list, I think:
Select([Contact.q.id, Contact.q.firstName, Company.q.companyN
Hey,
I'm trying to optimized a selection of 3000+ items and due to some of the
overhead of inheritance of SQLObject, I want to do a very specific query. I
like the idea of using SQLBuilder to generate the query string, but ran into
a bit of a problem.
It may be that I don't understand the prope