Hi,
I have a db model that looks like this:
class Photo(SQLObject):
filename = StringCol(length=30,alternateID=True)
keywords = RelatedJoin("Keyword")
shot_date = DateTimeCol(default=None)
place = StringCol(default=None)
class Keyword(SQLObject):
keyword = StringCol(alternateID=True)
photos = RelatedJoin("Photo")
Two questions:
1) How do I select all photos that have keyword1 AND keyword2?
2) What is the easiest way to build up a long select? Say I want to select
all photos where:
have keyword1 and keyword2 and date = '1/1/2007' and place = 'here'
I only don't know if all the columns will be present in the query (and there
will be more than these 3).
With SQL I would probably create temporary views on which I would do a new
select with every parameter.
How do I do this easily with SQLObject? Use sqlbuilder.AND and add a
parameter when it its present?
thx
-------------------------------------------------------------------------
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