Discussion:
[pylons-discuss] Reading a Zope ZODB from Pyramid?
Laurent DAVERIO
2018-07-30 16:01:54 UTC
Permalink
Hello list,

this may be a very silly question, and if so I apologize in advance, but
I'm not sure what to google.

Is it reasonable to try and read data from the ZODB of a Zope/CMF
instance directly from Pyramid, or should I write export routines in the
Zope app?

Thanks in advance,

Laurent.
--
You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discuss+***@googlegroups.com.
To post to this group, send email to pylons-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pylons-discuss/e29375c6-7f65-4544-dbac-eae666f6517d%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
Gael Pasgrimaud
2018-07-30 16:16:17 UTC
Permalink
Hi,
Post by Laurent DAVERIO
Hello list,
this may be a very silly question, and if so I apologize in advance, but
I'm not sure what to google.
Is it reasonable to try and read data from the ZODB of a Zope/CMF
instance directly from Pyramid, or should I write export routines in the
Zope app?
ZODB use pickle to store your objects' instances. This mean that you'll need
to make available all the classes (python code) used by Zope/CMF to
deserialize objects in your pyramid app.

This maybe painfull but it seems doable since Zope/CMF are now available as
packages on pypi.

The easy way to try this is probably to install pyramid in your current
Zope/CMF venv, write a minimalistic pyramid app to access your ZODB, and
start it from this venv.

Hope this help.
Post by Laurent DAVERIO
Thanks in advance,
Laurent.
--
You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/pylons-discuss/e29375c6-7f65-4544-dbac-eae666f6517d%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discuss+***@googlegroups.com.
To post to this group, send email to pylons-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pylons-discuss/20180730161617.GA25464%40boiboite.
For more options, visit https://groups.google.com/d/optout.
Laurent DAVERIO
2018-07-31 10:08:31 UTC
Permalink
Thank you very much Gael,

I vaguely remembered about pickles, thanks for pointing that out. Unless
I'm mistaken, Python 2 and 3 use different pickling formats, so my
Pyramid app would also have be downgraded to Python 2...

Maybe I should try something else, after all.
Thanks for your help,

Laurent.
Post by Gael Pasgrimaud
ZODB use pickle to store your objects' instances. This mean that you'll need
to make available all the classes (python code) used by Zope/CMF to
deserialize objects in your pyramid app.
This maybe painfull but it seems doable since Zope/CMF are now available as
packages on pypi.
The easy way to try this is probably to install pyramid in your current
Zope/CMF venv, write a minimalistic pyramid app to access your ZODB, and
start it from this venv.
Hope this help.
Post by Laurent DAVERIO
Thanks in advance,
Laurent.
--
You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/pylons-discuss/e29375c6-7f65-4544-dbac-eae666f6517d%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discuss+***@googlegroups.com.
To post to this group, send email to pylons-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pylons-discuss/78e17265-167e-ef26-209b-743e134e820f%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
Laurent DAVERIO
2018-07-31 10:12:43 UTC
Permalink
Thank you very much Tres,

I think I'll choose a safer/saner way, even if I would have loved being
able to access the ZODB data directly...

Thanks for your help,

Laurent.
If you install all the Zope + CMF code such that it is importable from
within your Pyramid app, then you could just load the objects normally
(unpickling requires finding the class)
Reading pickle data (vs unpickling the instances) is a tricky problem, and
not one I'd be excited to tackle.
Tres.
--
You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discuss+***@googlegroups.com.
To post to this group, send email to pylons-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pylons-discuss/7ca9afc5-421a-ea39-3eb6-4f8ab288c3c9%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
Loading...