[Grok-dev] object relationships

Jeroen Michiel jmichiel at yahoo.com
Tue Feb 10 08:17:54 EST 2009

I'm preparing a how-to for this, but alas, I've run into a few problems
(perhaps I've mentioned them already):
If you do applyData in an AddForm on an object of a class implementing
IHasRelations, you get an exception, because, during the applyData function,
an IObjecModified event is sent, which triggers the updateRelations function
in event.py, where you try to get the Id of the object we just created. Of
course this object isn't in the ZODB yet, so the getId raises an exception.
It would be better to use queryId.

Also, while removing my app in the admin page, I got an error in
removeRelations in getUtility. Apparently, the utility is already
unregistered before getting to this function. a queryUtility solved this.
View this message in context: http://www.nabble.com/object-relationships-tp21706997p21933412.html
Sent from the Grok mailing list archive at Nabble.com.

More information about the Grok-dev mailing list