On 6/12/07, Rupert Redington <[EMAIL PROTECTED]> wrote:
Aleksander Kowalczyk wrote:
> On 6/8/07, Alek Kowalczyk <[EMAIL PROTECTED]> wrote:
>> Alek Kowalczyk <[EMAIL PROTECTED]> writes:
>> > Hi,
>> > I moved my content class from mypackage.mymodule.MyContentClass into
>> > mypackage.mysubpackage.mymodule.MyContentClass.
>> > But when started Zope and went to visit an object I have previously
>> created (of
>> > MyContentClass), I get:
>> > ComponentLookupError: ((<persistent broken
>> > instance '\x00\x00\x00\x00\x00\x00\x02q'>,
>> > <zope.publisher.browser.BrowserRequest instance
> I found a quite well working solution on
> I shouldn't announce success too early. The solution works but only
> first Zope run (i.e just after evolving the schema).
> Although classFactory returns proper class during evolve, the new class
> is not saved in ZoDB, so after next unghosting object get old class
> Here is my evolve script. I really don't know what more should I do to
> Zope/ZoDB write the new class name in ZoDB. Can someone help me a bit...
Somebody correct me if I'm wrong
I imagine you'd need to commit the transaction manually:
#dirty hack to substitute classFactory
context.connection._reader._factory = convertingClassFactory
root = context.connection.root().get(ZopePublication.root_name, None)
for object in findObjectsMatching(root, lambda x: True):
if hasattr(object, '_p_activate'):
object._p_changed = True
Hope that helps,
Yes, I've tried this already - it doesn't work too :(
I have removed this because I believe Zope.generations do the commit for me
after calling my evolve function.
Zope3-users mailing list