[Zope] Re: Getting at third-party modules in dtml?

2005-09-20 Thread Axel Straschil
Hi!

> before.  Is this documented somewhere?

Never seen a Documentation for that, everything in Zope that is not done
"Trough the Web" is "Use the source, Luke" documented.
I.E., this thread is worth a Documentation, but who will write it down
... ;-)

Lg,
AXEL.
-- 
Gentoo? Debian? RedHat? SuSE? *BSD? Stop the distri-war, make little user!

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Re: Getting at third-party modules in dtml?

2005-09-19 Thread Axel Straschil
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 . 

Lg,
AXEL.
-- 
Gentoo? Debian? RedHat? SuSE? *BSD? Stop the distri-war, make little user!

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )