[Zope-CMF] Re: Content types based on Python objects

Charlie Clark charlie at begeistert.org
Mon Dec 3 09:11:17 EST 2007


Am 29.11.2007 um 10:55 schrieb Charlie Clark:

>
> Lucky for me that some clever person came up with these  
> modules! ;-) Anything else I need to look out for?
>
> Not sure if this is entirely the correct way but I do not need an  
> essentially trivial object: a dictionary addressable by X, by Y and  
> (X, Y).
>
> This will be the storage for an editable table. I guess I should  
> probably be looking at zope.formlib or z3c.form for this but  
> looking at the documentation I'm not sure if the dictionary schema  
> is suitable as this is for an object that will be dynamically  
> resizable.
>
> This is going to be my first implementation from a Python object in  
> Zope using browser views so I'm quite excited!


After a brief cold-induced hiatus I'm please to report that things  
are working nearly as expected and once you've gone through the  
process things are indeed a lot tidier.

I've decided to bypass zope.formlib z3C.form for the time being to  
get a better idea for working with browser views and lump the  
processing into my __call__ method. I can add and delete rows and  
columns and save data, except that the contents of my tables, ie. the  
dictionary key and values don't survive a Zope restart.

My class head looks like this

class Table(UserDict, PortalContent):
	def __init__(self, id, rows=1, cols=1, *args, **kwds):  
UserDict.__init__(self, *args, **kwds) """Default table has one row  
and one column""" self.id = id

ie., I'm dependent upon Zope committing the changes to the database  
which it. Is there anything I'm missing like inheriting fom DublinCore?

Thanks!

Charlie
--
Charlie Clark
Helmholtzstr. 20
Düsseldorf
D- 40215
Tel: +49-211-938-5360
GSM: +49-178-782-6226





More information about the Zope-CMF mailing list