[Zope] 'helper' classes in External Methods

Tony McDonald tony.mcdonald@ncl.ac.uk
Fri, 3 Mar 2000 17:11:04 +0000


Can someone give me a pointer to what these helper classes actually 
do? Can I use them to setup lists and dictionaries that will be used 
over the lifetime of the Zope server?

This is an example from an external method that Pavlos posted a while back.

class MCQ:
         ''' helper class for MCQ system'''
         def __init__(self, score):
                 ''' constructor'''
                 self.score = 0
                 self.total_score = 0

What I would like to do is load up a template_lookups dictionary with 
quite a few entries;

for template_id in self.Actors.RENDER.objectIds():
         renderer = eval("self.Actors.RENDER.%s" % template_id)
         template_lookups[template_id] = renderer

Thing is, I need access to the ZODB in one of my methods later in the 
module and so the above code doesn't work (too many 'selfs'!).

Anyone got any ideas?
tone.
------
Dr Tony McDonald,  FMCC, Networked Learning Environments Project 
http://nle.ncl.ac.uk/
The Medical School, Newcastle University Tel: +44 191 222 5888
Fingerprint: 3450 876D FA41 B926 D3DD  F8C3 F2D0 C3B9 8B38 18A2