[Zope] More trouble with METAL and python product

Reggie Farmer RFarmer@md.aacisd.com
Thu, 4 Apr 2002 10:28:25 -0500


How/where do I find out about METAL, ZPTs and python products?  I'm working
in CMF.  I want to the metadata_edit_form and associated files to use an
existing xml schema to generate the meta data elements.  I'm having some
difficulty determining how the files relate to each other.

-----Original Message-----
From: Peter Bengtsson [mailto:mail@peterbe.com]
Sent: Thursday, April 04, 2002 10:01 AM
To: zope@zope.org
Subject: [Zope] More trouble with METAL and python product


Now I see what is wrong but not how to fix it.

I've got this python product that uses ZPTs and METAL. When I first visit 
index_html I get a cryptic error message saying something about the METAL 
definition.
The template that holds the METAL macro is called StandardLook and is 
defined like this:

PTF = PageTemplateFile
StandardLook = PTF('zpt/StandardLook', globals(), __name__='StandardLook')
index_html = PTF('zpt/index_html', globals())

If I then visit StandardLook it works; and thirdly I go to index_html again 
and it works. From then on it works fine.
After I refresh the product the same problem occurs again.

Again....

1. I refresh the product --> no error
2. http://localhost/myinstance/index_html  --> Error!!
3. http://localhost/myinstance/StandardLook  --> no error
4. http://localhost/myinstance/index_html  --> no error


It's obvious that the StandardLook instance needs to be rendered once so 
that Zope can remember that that is the macro template.
How do I solve this? What needs to be done?


Cheers,
Peter



_______________________________________________
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 )