[Zope] How to organize code in zope?

Terry Hancock hancock at anansispaceworks.com
Wed Jun 23 16:33:55 EDT 2004


On Friday 18 June 2004 11:21 pm, Gilbert Fine wrote:
> 	A newbie question: how can I organize the python code for Script
> Object in a reasonable way? How to put commonly used code in a module or a
> function, so that it is available to many python script objects?

There may be some additional options now, but I'll tell you what I've used:

1) You can cheat a little bit by defining functions and/or classes within
a Python Script. These are actually "nested functions" which will get
defined each time the script is called.  But they still have uses.

2) You can treat folders as "classes" and pythonscripts as "methods". If
there are in a position to be acquired by subfolders, the subfolders can
be like "class instances".  It's not quite a perfect analogy, but it
works well enough for some purposes.

3) Lastly, if you really need sound software engineering abilities,
you want to write a *Product* for Zope, not just scripts.  This isn't
really that hard, and is better documented now than it was.

HTH,
Terry

--
Terry Hancock ( hancock at anansispaceworks.com )
Anansi Spaceworks  http://www.anansispaceworks.com



More information about the Zope mailing list