[Zope-CMF] How to update modified classes in the zodb?
Luca Olivetti
luca@wetron.es
Fri, 08 Mar 2002 14:51:56 +0100
Luca Olivetti wrote:
Since nobody has replied, I had to find the solution by myself, and the solution was
RTFM ;-)
In this case strangely enough there's actually a FM and it's the Zope Developer's Guide
at http://www.zope.org/Documentation/ZDG
I'm posting here what I found in case it could be useful to others.
> 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.
The solution is explained at
http://www.zope.org/Documentation/ZDG/Products.stx
(look for "Evolving classes")
> 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?
http://www.zope.org/Documentation/ZDG/Security.stx
the right method is declareObjectProtected
Bye
--
Luca Olivetti
Wetron Automatización S.A. http://www.wetron.es/
Tel. +34 93 5883004 Fax +34 93 5883007