[Zope] Re: Zope digest, Vol 1 #1641 - 48 msgs

Tim Hicks tim@sitefusion.co.uk
Fri, 7 Sep 2001 15:12:45 +0100


> 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