2007/5/15, Oleg Broytmann <[EMAIL PROTECTED]>:
> 1) How do I select all photos that have keyword1 AND keyword2?
photos = []
for photo on Photo.select():
found = 0
for keyword in photo.keywords:
if keyword.keyword in ("test1", "TeSt2"):
found += 1
if found == 2:
photos.append(photo)
Cool, this works. The only thing is, now it makes a query for every photo in
the DB. Right now that would only be a couple thousand (3 I think), but that
could be more than 10 thousand in a couple of years. Would this slow things
really down with a SQLite db? And if so, is there another way to do this?
Another question bubbles up. Is there a way to create a dict out of a
SelectResult? Or a JSONifiable object?
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss