[Zope] Persistence Module Confustion

Jean-Francois.Doyon at CCRS.NRCan.gc.ca Jean-Francois.Doyon at CCRS.NRCan.gc.ca
Thu Feb 12 12:57:55 EST 2004


Your problem could be related to the allow_class ... allow_module take a
string parameter which is the parameter NAME.

To use allow_class however you need to first import it and pass the class
itself to the call.  Again: NOT a string, but the class itself.

For instance here's how I do it with a third-party module I have:

    from Projection import Projection
    allow_module('Projection')
    allow_class(Projection)

Hope this helps!
J.F.

-----Original Message-----
From: zope-bounces at zope.org [mailto:zope-bounces at zope.org]On Behalf Of
D. Bickle
Sent: Thursday, February 12, 2004 12:03 PM
To: Lennart Regebro
Cc: zope at zope.org
Subject: Re: [Zope] Persistence Module Confustion


Actually I sorted this out. I didn't realize there was a MailHost option
in the pull down menu ;| As far as loading modules go I have been able to
solve this problem by creating my own custom Product and setting the
security declarations in __init__.py.

I am still having a problem importing a Python module I created containing
some class objects. I placed the module in the Products directory
and modified the __init__.py module accordingly. I've tried adding both
allow_module(<module_name>) and allow_class(<class_name>) to the __init__
file. Both don't seem to work even after restarting zope.

Any ideas?

Thanks

On Thu, 12 Feb 2004, Lennart Regebro wrote:

> From: "D. Bickle" <dbickle at uvic.ca>
> > I am trying to import the MailHost module that has dependencies with the
> > Persistence module. The interpreter complains that it cannot load the
> > Persistence modules When I examine the package there is no content or
> > modules.
>
> When does this happen?
>
> Are you trying to import MailHost "manually" outside Zope, or is it you
Zope
> instance that complains?
>
>

_______________________________________________
Zope maillist  -  Zope at 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 )



More information about the Zope mailing list