Re: Zope digest, Vol 1 #1641 - 48 msgs
Date: Fri, 7 Sep 2001 12:59:05 +0400 From: Oleg Broytmann <phd@phd.pp.ru> To: zope@zope.org Subject: Re: [Zope] Kaivo CatalogQuery-0.1.1 Reply-To: Oleg Broytmann <phd@phd.pp.ru>
On Fri, Sep 07, 2001 at 01:31:41AM +0100, Tim Hicks wrote:
results = context.Catalog.query('title==search', REQUEST) # or paint==search or exhibition==search or style==search or for_sale==search)
From this, I get:
Error Type: NameError Error Value: name 'search' is not defined
The problem, I tink in the syntax 'title==search'. Here "title" is the name of argument (passed to Python function), but you declare that "search" is a name of a variable. You have no such variable, hence NameError. Try 'title=="search"' (thta is, pass "search" as a string, not var).
Sorry, I'm not sure if I was totally clear in my original question. If I understand correctly, using you suggestion would result in the query returning all items in the catalog whose title attribute matches the string "search". I want to be able to return all items whose title attribute matches the variable 'search' which is in the request (i.e. if the url ends like this: results_py?search=portrait , portrait is the string that is searched for in the 'title' index). Am I misunderstanding things still? cheers tim
On Fri, Sep 07, 2001 at 03:12:45PM +0100, Tim Hicks wrote:
Error Type: NameError Error Value: name 'search' is not defined
The problem, I tink in the syntax 'title==search'. Here "title" is the name of argument (passed to Python function), but you declare that "search" is a name of a variable. You have no such variable, hence NameError. Try 'title=="search"' (thta is, pass "search" as a string, not var).
Sorry, I'm not sure if I was totally clear in my original question. If I understand correctly, using you suggestion would result in the query returning all items in the catalog whose title attribute matches the string "search". I want to be able to return all items whose title attribute matches the variable 'search' which is in the request (i.e. if the url ends like this: results_py?search=portrait , portrait is the string that is searched for in the 'title' index).
Then it seems you have no variable "search" in the namepsace. Other than that you are correct. Oleg. ---- Oleg Broytmann http://www.zope.org/Members/phd/ phd@phd.pp.ru Programmers don't die, they just GOSUB without RETURN.
participants (2)
-
Oleg Broytmann -
Tim Hicks