[Zope] Executing a text file as a ZPT from a product

Tres Seaver tseaver at palladion.com
Sun May 3 16:37:24 EDT 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jakob Schou Jensen wrote:
> Im am writing a product and would like to include ZPT's as part of the
> product. Is there a way that I can evaluate a piece of text (preferrably
> stored as a text file in the product folder) as a ZPT?

Something like:

  from App.Common import package_home
  from OFS.SimpleItem import SimpleItem
  from Products.PageTemplates.PageTemplateFile import PageTemplateFile

  class MyClass(SimpleItem):

      some_name = PageTemplateFile('some_name.pt',
                                   package_home(globals())


Tres.
- --
===================================================================
Tres Seaver          +1 540-429-0999          tseaver at palladion.com
Palladion Software   "Excellence by Design"    http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJ/gCE+gerLs4ltQ4RAjlXAKC02WUqOT0kiPOBTbjHKv9GFIRPIQCfTIw8
YrYRr+irI11VLP9h6iJ+ps0=
=mOID
-----END PGP SIGNATURE-----



More information about the Zope mailing list