Re: [Zope-dev] more persistent mapping misery

2004-01-01 Thread Chris McDonough
On Thu, 2004-01-01 at 14:16, Dieter Maurer wrote:
> There is also the "__module_aliases__" directive in
> product initialization code. It is used (e.g.) for
> "PythonScripts".
> 
> It does things very similar to what you did (it is slightly more
> careful as it does not override an existing module)
> but it is nice to stick to a single way to solve such
> problems.

Right, thanks... I'm not sure it should be handled via
__module_aliases__, because it's not a problem that's local to any
particular Product, though.

- C



___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] more persistent mapping misery

2004-01-01 Thread Dieter Maurer
Chris McDonough wrote at 2003-12-30 20:13 -0500:
>On the HEAD recently, a bunch of changes were made to the Persistence
>package.  Notably, the Persistence.PersistentMapping module was removed
>in favor of a Persistence.mapping module.  Unfortunately, there are
>instance pickles lying around in any CMF instance created prior to the
>changes (DiscussionItem's _container attribute is the one I found) which
>explicitly refer to Persistence.PersistentMapping.PersistentMapping. 
>This name can no longer be resolved to a class.  This breaks b/w
>compatibility.
>
>I "fixed" the issue by adding the following to the Persistence package's
>__init__.py:
>
>sys.modules['Persistence.PersistentMapping'] =
>sys.modules['Persistence.mapping']
>
>That seems really ugly, though.  Is there a better way to fix it?

There is also the "__module_aliases__" directive in
product initialization code. It is used (e.g.) for
"PythonScripts".

It does things very similar to what you did (it is slightly more
careful as it does not override an existing module)
but it is nice to stick to a single way to solve such
problems.

-- 
Dieter

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )