Re: [SQLObject] Looking for selection hints
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
|
From: Frank B. <fb...@fo...> - 2003-10-27 00:01:48
|
Hallo,
Ian Bicking hat gesagt: // Ian Bicking wrote:
> On Sunday, October 26, 2003, at 04:48 PM, Frank Barknecht wrote:
> > {'title': ['rock'], 'format': ['cd'], 'artist': ['strokes', 'the']}
>
> query = None
> for colName, ops in above_dict.items():
> for op in ops:
> subquery = LIKE(getattr(Product.q, colName), op)
> if query:
> query = AND(query, subquery)
> else:
> query = subquery
>
>
> It might be nice if Product.q allowed dictionary access too. And if
> AND(anything, None) return anything. But this will work too.
I *knew* it had to be something basic (or built-in). A thousand thanks
for opening my eyes.
ciao
--
Frank Barknecht _ ______footils.org__
|