If I define a class in an external method, how can I expose it so that my Zope python scripts can access it? The only solution I've found is something like this: class Foo(): def method1(self, parms) ... def method2(self, parms) ... def newFoo() return Foo() def fooMethod1(oFoo, parms) return oFoo.method1(parms) ... and so forth. I then need to add separate External Methods for newFoo(), fooMethod1(), etc. Is there any way once I have a reference to an instance of Foo, that I can call its methods directly? Or is this simply not possible in Zope? ___/ / __/ / ____/ Ed Leafe http://leafe.com/ http://opentech.leafe.com
See both "Module Security Assertions" and "Class Security Assertions in Non-Module Code" in http://www.zope.org/Documentation/Books/ZDG/current/Security.stx. On Thu, 2003-02-20 at 10:57, Ed Leafe wrote:
If I define a class in an external method, how can I expose it so that my Zope python scripts can access it? The only solution I've found is something like this:
class Foo(): def method1(self, parms) ... def method2(self, parms) ...
def newFoo() return Foo()
def fooMethod1(oFoo, parms) return oFoo.method1(parms)
... and so forth. I then need to add separate External Methods for newFoo(), fooMethod1(), etc. Is there any way once I have a reference to an instance of Foo, that I can call its methods directly? Or is this simply not possible in Zope?
___/ / __/ / ____/ Ed Leafe http://leafe.com/ http://opentech.leafe.com
_______________________________________________ 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 )
On Thursday, February 20, 2003, at 11:06 AM, Chris McDonough wrote:
See both "Module Security Assertions" and "Class Security Assertions in Non-Module Code" in http://www.zope.org/Documentation/Books/ZDG/current/Security.stx.
Great! That's what I needed. Thanks. ___/ / __/ / ____/ Ed Leafe http://leafe.com/ http://opentech.leafe.com
On Thursday, February 20, 2003, at 11:06 AM, Chris McDonough wrote:
See both "Module Security Assertions" and "Class Security Assertions in Non-Module Code" in http://www.zope.org/Documentation/Books/ZDG/current/Security.stx.
OK, I've followed the directions on that page, but one of the lines is causing a problem when I re-import the modified External Method: from Acquistion import Implicit When I import the External Method with that line added, I get the following error: Error Type: ImportError Error Value: No module named Acquistion Um, isn't this something basic in Zope? I have a file in [zopedir]/lib/python named Acquisition.so, but nothing else that I can find. Am I missing something? ___/ / __/ / ____/ Ed Leafe http://leafe.com/ http://opentech.leafe.com
You misspelled Acquisition. ;-) On Thu, 2003-02-20 at 12:26, Ed Leafe wrote:
On Thursday, February 20, 2003, at 11:06 AM, Chris McDonough wrote:
See both "Module Security Assertions" and "Class Security Assertions in Non-Module Code" in http://www.zope.org/Documentation/Books/ZDG/current/Security.stx.
OK, I've followed the directions on that page, but one of the lines is causing a problem when I re-import the modified External Method:
from Acquistion import Implicit
When I import the External Method with that line added, I get the following error:
Error Type: ImportError Error Value: No module named Acquistion
Um, isn't this something basic in Zope? I have a file in [zopedir]/lib/python named Acquisition.so, but nothing else that I can find. Am I missing something?
___/ / __/ / ____/ Ed Leafe http://leafe.com/ http://opentech.leafe.com
On Thursday, February 20, 2003, at 12:56 PM, Chris McDonough wrote:
You misspelled Acquisition. ;-)
Doh! That's what I get for copy/pasting from the web page! OK, fixed that. It's working now. Thanks again for your help. ___/ / __/ / ____/ Ed Leafe http://leafe.com/ http://opentech.leafe.com
participants (2)
-
Chris McDonough -
Ed Leafe