Re: [SQLObject] Enhanced IN Operator, interest in patch?
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Oleg B. <ph...@ph...> - 2011-03-22 09:39:02
|
On Tue, Mar 22, 2011 at 10:26:22AM +0100, Gregor Horvath wrote: > But I would prefer to make an optional argument 'columns' to > queryForSelect, because it is not obvious that the columns / items can > be changed after initialisation. > > so it would be > > list_ = list_.queryForSelect(columns=[list_.sourceClass.q.id]) Hmm... I don't like this approach, at least at the first glance. I have to think about it, but now I'd rather split queryForSelect into two functions. Something like this: def queryForSelect(self): columns = [self.sourceClass.q.id] + [getattr(self.sourceClass.q, x.name) for x in self.sourceClass.sqlmeta.columnList] return self.makeQuery(columns) def makeQuery(self, columns): query = sqlbuilder.Select(columns, ... Oleg. -- Oleg Broytman http://phdru.name/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |