On 8 August 2010 20:29, Hanno Schlichting <ha...@hannosch.eu> wrote:

> There should be some way of doing this with custom __getstate__ and
> __setstate__ methods.
>
> It's just tricky to get right and a bit fragile. It's much easier to
> write the migration code if both the old and new class are separate
> and functioning at the same time.

The main problem is that the advertised API says you should do:

from plone.registry import Record
from plone.registry import field

registry['foo.bar'] = Record(field.TextLine(), u"my value")

Here, field.TextLine derives from PersistentField which derives from
Persistent, and Record derives from Persistent also.

If I wanted to get rid of the Persistent base, I'd have to make a new
"tree" of field types (the standard zope.schema ones still need some
subclassing), and a new Record class with a less obvious name.

Martin
_______________________________________________
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )

Reply via email to