[Zope] CatalogQuery newbie question
Dieter Maurer
dieter@handshake.de
Mon, 26 May 2003 20:21:02 +0200
Stephan Goeldi wrote at 2003-5-26 15:03 +0200:
> > It's a question of someone that did not read the available documenta=
tion
> > carefully...
>=20
> I read it very carefully, but don't seem to be the ideal target group
> ;-)
>=20
> My problem is, that I see this example in the query:
>=20
> title =3D=3D =E2=80=99spam=E2=80=99 or PrincipiaSearchSource =3D=3D =E2=
=80=99spam=E2=80=99
>=20
> I would now replace the word 'spam' with a word, entered in a search
> form. I tried:
>=20
> <dtml-in expr=3D"Catalog.query(title =3D=3D &dtml-word or
> PrincipiaSearchSource =3D=3D &dtml-word)">
>=20
> which doesn't work (same for some variants of the above).
>=20
> Do you believe me now, that I am a newbie?
Apparently, you are also a person who does not like to read :-(
I am sure, I not only wrote the (potentially insulting)
phrase quoted above but also listed two options for you.
1. Use Python's format operator ("%") (see Python Library Reference)
2. Use ZCatalogQuery's parameter interpolation (see
the ZCatalogQuery documentation).
I looked it up for you: It is the "CatalogQuery-HowTo"
document, section "Expressions in Queries".
There is an example there, ready to use....
And as the above 'expr=3D"...&dtml-XXX;"' indicates additional need
for background reading, you should read the Zope Book
or maybe
<http://www.dieter.handshake.de/pyprojects/zope/book/chap3.html>
You can be sure that without carefull background reading,
your work with Zope will take at least an order of magnitude
longer than necessary.
Dieter