[Zope] Tal:condition problem
KevinL
darius@obsidian.com.au
21 Aug 2002 00:05:04 +1000
The way you define macroName wasn't what I was complaining about - it
was what you do with macroName afterwards. You can't drop it into the
metal use-macro statement, because it contains multiple path elements.
That means you likely have to write a python script or python product
method to return the macro, instead of finding it in ptl - which means
what are essentially display decisions (which template do I use) are
being pushed out of ptl.
Something else (unconnected) that occurred to me - is "id" still a bad
variable name to be using in forms? That one makes me nervous in Zope
and MySQL...
KJL
On Tue, 2002-08-20 at 23:54, Paul Winkler wrote:
> On Tue, Aug 20, 2002 at 10:11:30PM +1000, KevinL wrote:
> > Heh. After posting this, I looked closer at your list below, and
> > realised you're altering both the macro file name, and the name of the
> > macro inside the file.
> >
> > That'd require that you be able to replace multiple elements of the
> > macro name, rather than a single. That's not doable atm. I still
> > reckon it should be... Then you'd be covered by a tal:define="macroName
> > string:container/zptmac_${request/id}task/macros/zptmac_${request/id}list".
>
> Sure you can do it, just use python. How about this;
>
> tal:define="macroName python:'container/zptmac_%stask/macros/zptmac_%slist' % (request.form['id'], request.form['id'])"
>
> Or if that's too ugly, make it a python script that takes a single "id"
> parameter and just call that.
>
> --
>
> Paul Winkler
> "Welcome to Muppet Labs, where the future is made - today!"
>
> _______________________________________________
> Zope maillist - Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> ** No cross posts or HTML encoding! **
> (Related lists -
> http://lists.zope.org/mailman/listinfo/zope-announce
> http://lists.zope.org/mailman/listinfo/zope-dev )
>