Hi, On Tue, 22 Mar 2011 12:01:54 +0300 Oleg Broytman <p...@phdru.name> wrote:
> Hi! > > On Tue, Mar 22, 2011 at 09:27:04AM +0100, Gregor Horvath wrote: > > def IN_(item, list_): > > if isinstance(list_, SelectResults): > > list_ = Select([list_.sourceClass.q.id], > > where=list_.clause, > > join=list_.ops.get('join', NoDefault), > > distinct=list_.ops.get('distinct',False), > > lazyColumns=list_.ops.get('lazyColumns', > > False), start=list_.ops.get('start', 0), > > end=list_.ops.get('end', None), > > orderBy=list_.ops.get('dbOrderBy', > > NoDefault), reversed=list_.ops.get('reversed', False), > > staticTables=list_.tables, > > forUpdate=list_.ops.get('forUpdate', False)) > > Isn't this just > > query = list_.queryForSelect() > query.ops['items'] = [list_.sourceClass.q.id] > > Thank You. Yes this is equivalent and more compact. 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]) -- Gregor ------------------------------------------------------------------------------ Enable your software for Intel(R) Active Management Technology to meet the growing manageability and security demands of your customers. Businesses are taking advantage of Intel(R) vPro (TM) technology - will your software be a part of the solution? Download the Intel(R) Manageability Checker today! http://p.sf.net/sfu/intel-dev2devmar _______________________________________________ sqlobject-discuss mailing list sqlobject-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss