[Zope3-dev] Calling persistent function

Danny Smith pythonlover75 at yahoo.com
Thu Jan 22 16:14:59 EST 2004


--- Jim Fulton <jim at zope.com> wrote:
> Jim Fulton wrote:

> I should add that I'm open to suggestions as to how
> they should
> be used.  

I think ZPTers want to call scripts just like Zope2
python scripts.  This goes under the audience of
website scripters (in the Wiki) who can "break the
rules" and do things "quick and dirty".

> Some other notes:
> 
> - It will eventually be possible to use them via the
> zpt module
>    namespace:
> 
>    modules/foo.bar/myfunc

That would be great.  I know it does not mean much
given that python script can be embedded directly into
a template, but it's more familiar code managment.

One problem I have with that is that
modules['time'].asctime() is forbidden in zpt.  How do
I put the time and date in a zpt template?  This
definately falls into the category of "one-liner" in
every web framework I've ever used, including Zope 2.

As far as I can tell, in Zope 3 I need to create a
TimeUtility, register it in ZCML, query the utility
service and then it works.

Am I missing something?



__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/



More information about the Zope3-dev mailing list