[Grok-dev] zope.generations and IIntIds issue

Jeroen Michiel jmichiel at yahoo.com
Fri Jul 1 03:26:45 EDT 2011


I solved the problem using a different approach.
What I was doing was this: in my previous generation I has a class that
derived from grok.Model, and in my current generation, I need it to be a
grok.Container, so I needed to do some trickery to get the old data from the
database to be able to create a new instance. Maybe that confused the
KeyReference creation somehow. That's why I put it in grok-dev, but forgot
to mention it ;-)

Now that I'm at it: what is the recommended way to do something like that?
I moved the old class definition to my evolveX script, and before loading
the old instances from the db, I replaced the new definition in the
appropriate module with the old one, and before creating new instances, I
switched the definitions back to normal. That seemed to do the trick.
However, is there a nicer way to do it, or a way to just upgrade existing
instances to the new definition without having the create new ones and
copying the old data?


Christian Klinger wrote:
> 
> Hi Jeroen,
> 
> sorry i don't a answer for your question. I guess this is not a grok 
> related problem, so i recommend to put this post on
> 
> gmane.comp.web.zope.devel
> 
> too. You will reach more people there.
> 
> Christian
> 
> _______________________________________________
> Grok-dev mailing list
> Grok-dev at zope.org
> https://mail.zope.org/mailman/listinfo/grok-dev
> 
> 

-- 
View this message in context: http://old.nabble.com/zope.generations-and-IIntIds-issue-tp31955225p31971448.html
Sent from the Grok mailing list archive at Nabble.com.



More information about the Grok-dev mailing list