[Zope] getting zclass instance

Dieter Maurer dieter@handshake.de
Tue, 16 Jul 2002 21:35:04 +0200


John Hunter writes:
 > 
 > I have a product Course that defines a ZClass Course and several other
 > Zclasses (Student, Submission, Section) etc...  A course might be
 > instantiated in a folder or at the root level, and can contain
 > sections which can contain students, which can contain submissions and
 > so on.
 > 
 > I want to have a Course method called get_course which returns the
 > Course instance, eg if I call
 > 
 > http://server:8080/folder/BioSci101/Section12/BillStudent/TermPaper/some_method_py
 >                             ^
 >                         the Course
 >                                       ^
 >                                     The Section
 >                                                  ^
 >                                              The Student
Try the following:

    Make a Python Script "get_course" with the body "return container".


Apparently, the "container" of a Python Script ZClass method is
the corresponding ZInstance.


Dieter