[Zope] - Misc questions & Suggestions

Jim Fulton jim@Digicool.com
Tue, 08 Dec 1998 16:40:53 +0000


David Ascher wrote:
> 
(snip)

> 5) I think I may have found a bug (and a fix!).  I was trying to add an
>    External Method.  I did the following:

(patch snipped)

I posted a similar change earlier.  The fix will be
included in the next release.

 
> 6) Is there a way to make Zope *reload* the Python module from disk w/o
>    restarting Zope?

Other's have mentioned how ExternalMethods are reloaded.  It is also
theoretically possible to get other modules reloaded.  It involves 
some careful handling of database objects so that the changes have 
an effect. There's some machinery in ExternalMethod to attempt this.
It's been a while since I tried it and can't say at this point how well
it works.
 
> 7) I assume that the current mechanism of adding modules in "Extensions"
>    folders for external methods and adding modules in lib/python for
>    things that need to be imported will be revised to be more scalable,
>    right? 

That's not really the current approach.  Unfortunately, the current
approach is not documented.

Generally, new modules should go in Product packages or Shared packages.
Note that I said *packages*.  Zope is very package-centric. All new modules
(excluding extentions, like ExternalMethods, should be in packages.
The Products package is for packages that provide meta data telling Zope 
how to fold products into the Zope menus and security system.  Shared packages
are for packages that may be shared between multiple products.  This is hard
to see right now, because there aren't any shared packages in the release, and
we are still in the process of converting our products to use this scheme.
Note that the Shared package will be subdivided by organization.

For example, when Z SQL Methods (formally known as Aqueduct) is released, 
it will be layed out as follows:

  lib
    python
      Products
        ZSQLMethods
        ZGadflyDA
      Shared
        DC
          ZRDB

where 
  ZSQLMethods provides the ability to add SQL methods,
  ZGadflyDA provides access to Gadfly databases, and
  ZRDB provides code shared by these and other products that deal
  with relational data.

>    This approach seems to view code completely unlike data, which
>    is sort of strange coming from the Zope Way -- but I can understand
>    that it hasn't been a problem in the past since only the Principia
>    developers were probably adding Python code.  Still, I want automatic
>    version control of external methods just like version control of my
>    HTML documents!

There are pros and cons with storing Python code in the database.
This is an issue worthy of further consideration, although I won't
have the bandwidth fow quite a while. I don't think
it has *that* much to do with who is doing development.  I think that
the package scheme we're using should go a long way toward organizing
modules.

(snip)

Jim

--
Jim Fulton           mailto:jim@digicool.com
Technical Director   (540) 371-6909              Python Powered!
Digital Creations    http://www.digicool.com     http://www.python.org

Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email
address may not be added to any commercial mail list with out my
permission.  Violation of my privacy with advertising or SPAM will
result in a suit for a MINIMUM of $500 damages/incident, $1500 for
repeats.