[Zope] Re: Using multiple .fs files (was: converting Python ap to Zope)

Joachim Werner joe@iuveno-net.de
Tue, 4 Dec 2001 04:29:28 +0100


Hi!

To be honest, your app seems to be more complex than I can bear at the
moment. So again only some minor hints ...

> I tried these demos for using ZODB for persistence.  Worked great.  But
> when I tried to open live data.fs there are two obvious problems.  2)
> the structure of data.fs is *complex*, and I didn't know where to start
> with putting data in that would be accessible by Zope users, and 1) it
> cannot be accessed while Zope is running.

Use ZEO for that. You can export a ZODB via ZEO and then use it from
different clients (be it a Zope or something else). Never done that, but
there is some howto or so about it ...

The other mail:

2001-12-03T19:24:47 PROBLEM(100) Init Ambiguous name for method of
Products.Site
Access.SiteRoot.SiteRoot: "manage" != "manage_main"

This is nothing bad. But it SHOULD be the same whether you use your own
Python or Zope's. Very funny ...

JW> This irritates me most. If you have the ZODB, why would you want to do
JW> pickling on your own? I guess some refactoring of the code and doing it
the
JW> Zope way would help a lot here. Even if you used Python standalone,
using
JW> the ZODB as a storage would be much more comfortable than pickling to
files.

"I *don't* want to pickle on my own.  That is just the way the
application is currently saving the tables.  I would like to un-pickle
the existing files using the modified ZODB persistent classes but since
pickle loads the classes from the original modules, I don't see how this
is possible.  (Q2: is it?)  I suppose I could write a conversion program
copies each class (and attributes) and data structure manually over to a
Zope instance."

Everything is possible. But I'd still prefer a more radical refactoring,
where you change the storage implementation to ZODB. Your ORIGINAL classes
become Zope base classes, so there is no problem with having two base
classes for the same pickle or so.

JW> Why would you want to pickle a .DLL file? Or did I get that wrong? Your
JW> problem sounds a bit as if you wanted to store a full version of Word
2000
JW> with every .doc file you create because you might need it the next time
you
JW> work with the document. But maybe I just don't get the point ...

"I don't want to pickle the .dll.  I just want to be able to call the
.dll from anywhere in Zope.  I was thinking something like the following
(invalid) code in my __init__ for the Product:

import Mk4py
root['mk'] = Mk4py

So all methods could access code like "mk.open(...)" using the same
object.  I might be thinking down the wrong path.  (I have been know to
do that on occasion)."

Do it as you'd do it from Python. There is nothing Zope-specific about it
...

Joachim