[ZPT] Build Template w/Macros from Python

Jim Kutter jim@ebizq.net
Thu, 1 Aug 2002 17:36:11 -0400


It has to do with that I need to use that form from two very different =
scripts. I figured out a solution, and that cleaned up teh code a bit =
since I was being a bit redundant to start with.

The form had only the form html code, and the entry.html had the =
use-macro call, and basically "included" the form via a tal:replace =
call. What was happening was options indended for the form template =
weren't making it when I called the entry.html template from the script.

I managed to solve my little problem by removing the use-macro call from =
entry.html and having the form call the macro and having the entry.html =
simply include the form.

Thanks though.

----- Original Message -----=20
From: "Evan Simpson" <evan@4-am.com>
To: "Jim Kutter" <jim@ebizq.net>
Cc: <zpt@zope.org>
Sent: Thursday, August 01, 2002 5:27 PM
Subject: Re: [ZPT] Build Template w/Macros from Python


> Jim Kutter wrote:
>  > I have a page (entry.html) that does the use-macro jazz, and
>  > tal:replaces a form (form.html) into that page (I need the form =
code
>  > elsewhere too).
>  >
>  > I also have a python script (process.py) that is the target of that
>  > form that does validation, etc... If there's an error with the =
form,
>  > that script writes the error messages to options/message, then
>  > returns the form (form.html) with those options.
>  >
>  > Problem is I want the form to have the decorations with it that the
>  > use-macro(in entry.html) uses when it (form.html) is returned from
>  > the python script(process.py).
>=20
> Sorry, I almost-but-don't-quite follow this.  You mention both =
use-macro=20
> and tal:replace, which are both possible methods for embedding =
form.html=20
> -- which are you using on what?  If you want the stuff from entry.html =

> wrapped around form.html, why not return it (entry.html) from the =
script=20
> instead?
>=20
> Cheers,
>=20
> Evan @ 4-am
>=20
>=20