[Zope] Re: Getting at third-party modules in dtml?
Axel Straschil
axel at straschil.com
Tue Sep 20 00:07:53 EDT 2005
Hi!
> Say I have a function that I want to make callable in
> my UI. It needs to be globally available, i.e. it needs to
> be callable *without* having an instance of my product yet.
> (This has to do with listing information about all acquirable
> instances of the product, so the user can choose from those
> available.)
In a Product's __init__.py:
def theSecret(self):
return "A hobbit!"
methods = {
'whatIsFrodo': theSecret
}
Save that i.E. in MyInstance/Products/MyFancy/__init__.py, restart Zope
And than <dtml-var whatIsFrodo>.
Lg,
AXEL.
--
Gentoo? Debian? RedHat? SuSE? *BSD? Stop the distri-war, make little user!
More information about the Zope
mailing list