[Zope-CMF] How to update modified classes in the zodb?

Luca Olivetti luca@wetron.es
Mon, 04 Mar 2002 09:37:11 +0100


Hi,
I'm following this tutorial
http://cmf.zope.org/Members/apassant/CMFTutorial/tutoriel/view
to develop my own CMF types (btw: I don't speak french but I can understand some of it, 
and this is the only good, kudos to the author, example I found on how to develop cmf 
types, and it's not even linked from the 'doc' folder at the cmf site).
Anyway, now I have my type mostly working but I'd like to know what should I do if I 
need to modify the class, e.g. in order to add a field, how do I update all instances 
already in the zodb. While I'm developing my application I don't mind to erase all 
previosly created content, but obviously this is not an option when it goes live.

Another slightly unrelated question is, where do I restrict 'View' privilege on my type?
I saw that, for example, CMFCollector uses declareProtected for each method that 
accesses some attribute of the class.
Wouldn't it be enough to use declareProtected instead of declareObjectPublic at the 
beginning of the class?


class myClass(PortalFolder, PortalContent)
    """  my first CMF class """

    meta_type = 'my class'

    security = ClassSecurityInfo()

    security.declareProtected('my view permission')




Bye
-- 
Luca Olivetti
Wetron Automatización S.A. http://www.wetron.es/
Tel. +34 93 5883004      Fax +34 93 5883007