AW: [Zope] syntax or namespace problem

notices notices@fiberfolk.com
Wed, 24 Apr 2002 12:59:40 -0700 (PDT)


Thanks, but I can get badsearch from the Template. I need help getting it from the DTML page. 
Annie

--- <trash.mail@gmx.ch> wrote:
>Try:
>global badsearch request/badsearch;
>
>
><body tal:define=3D"results here/getCatalogpy;
>                    start request/start|python:0;
>                    searchby request/searchby;
>                    searchtext request/searchtext;
>                    global badsearch request/badsearch;
>                    batch python:modules['ZTUtils'].Batch(results,=20
>                                                          size=3D10,=20
>                                                          start=3Dstart);
>                    previous python:batch.previous;
>                    next python:batch.next">=20
>
>
>Mit freundlichen Gr=FCssen
>Roger Ineichen
>___________________________
>
>Projekt01 GmbH
>www.projekt01.ch
>Langackerstrasse 8
>6330 Cham
>phone  +41 (0)41 781 01 78
>mobile +41 (0)79 340 52 32
>fax    +41 (0)41 781 00 78
>email  r.ineichen@projekt01.ch
>___________________________
>END OF MESSAGE=20
>
>-----Urspr=FCngliche Nachricht-----
>Von: zope-admin@zope.org [mailto:zope-admin@zope.org] Im Auftrag von
>notices
>Gesendet: Mittwoch, 24. April 2002 15:43
>An: zope@zope.org
>Betreff: [Zope] syntax or namespace problem
>
>
>Hi. I'm having a wonderful time with zope for the most part,  but here
>is my snag. I can't seem to access a variable=20
>in the request called badsearch from DTML.
>
>I have a script named getCatalogpy that returns search results in a
>catalog,=20
>and if the number of results is too small, it sets a flag like so-
>
>(first)
>request =3D container.REQUEST
>request.set("badsearch","false")
>
>(then later on)
>found =3D container.np.phone.phoneCatalog()
>        if len(found)>=3D mingoodsearch:
>            return found
>        request.set("badsearch","true")=20=20=20=20
>
>I can get badsearch from my Page Template for Results, like so.
>
><body tal:define=3D"results here/getCatalogpy;
>                    start request/start|python:0;
>                    searchby request/searchby;
>                    searchtext request/searchtext;
>                    badsearch request/badsearch;
>                    batch python:modules['ZTUtils'].Batch(results,=20
>                                                          size=3D10,=20
>                                                          start=3Dstart);
>                    previous python:batch.previous;
>                    next python:batch.next">=20
>
>
>then it's used here:
>
><span tal:condition=3D"python:(badsearch=3D=3D'true')">We find no matches.
>Here is the entire list.<br></span>
>
>so far, so good. But I also have a results page for WAP/WML browsers
>that uses the same script.=20
>It's done in DTML because a Page Template has to be good HTML, which WML
>is not.
>
>I want something like=20
>
><dtml-if "badsearch =3D=3D 'true'">
>We find no matches. Here is the entire list.<br />
></dtml-if>
>=20
>but Zope can't find badsearch. It must be in the request, because the
>Page Template can find it after the script. I tried request/badsearch
>and a number of syntax variations.=20
>
>Thank you very much for your assistance,
>Annie
>
>
>_______________________________________________
>Zope maillist  -  Zope@zope.org
>http://lists.zope.org/mailman/listinfo/zope
>**   No cross posts or HTML encoding!  **
>(Related lists -=20
> http://lists.zope.org/mailman/listinfo/zope-announce
> http://lists.zope.org/mailman/listinfo/zope-dev )