[Zope] Question about application design

Alec Mitchell apm13 at columbia.edu
Tue Apr 20 14:09:29 EDT 2004


On Tuesday 20 April 2004 10:35 am, Robb Shecter wrote:
> Ausum Studio said:
> Is there a way, from a Python script to just add python objects to a
> container?
>
> For example, a list of strings to a folder?
>
> I looked in the API for Folder, (and then Content Manager), and saw that
> one can only add content by adding products.  So, does that mean that
> arbitrary data can't be stored and retrieved from containers (like
> temp_folder)?

You can store a list of strings as a property of the Folder (look at the 
PropertyManager API).  It might not be terribly efficient, and will likely 
not work for more complex structures.  The better option may be a simple 
python product implementing some sort of persistent object which stores the 
data structures and access methods you need (OOBTrees and OOSets might be 
more convenient than standard lists and mappings because they are naturally 
persistent), that product could also encapsulate your existing python logic 
in any number of ways.

Alec Mitchell



More information about the Zope mailing list