[Grok-dev] serializing and deserializing models to XML
Martin Aspeli
optilude at gmx.net
Sun Dec 28 17:41:12 EST 2008
Brandon Craig Rhodes wrote:
> I would like to get a set of (megrok.rdb-backed) objects and write them
> out as XML, where the object references between them become temporary
> IDs in the XML file, and get rebuilt when I pull the objects back in.
> Is there a module that does this? Should I be looking at something like
> z3c.schema2xml? I don't want to write my own one-off deserializer if
> there is already one available that I could help work on.
I think the schema2xml package deals with serialising and de-serialising
things described by zope.schema type interfaces.
plone.supermodel (in the plone svn repository) deals with serialising
and de-serialising interface models themselves, although the code it
does to do that relies on the self-describing nature of zope.schema and
so should be useful to generically parse any structure described by
zope.schema fields. It's based on older code in the GS handlers in
plone.app.portlets and plone.app.contentrules which deal with
serialising and de-serialising portlet/content rule instances.
Martin
--
Author of `Professional Plone Development`, a book for developers who
want to work with Plone. See http://martinaspeli.net/plone-book
More information about the Grok-dev
mailing list