[Zope] adding product-based objects programmatically

Dieter Maurer dieter at handshake.de
Fri Aug 4 14:11:54 EDT 2006


Kees de Brabander wrote at 2006-8-3 20:39 +0200:
> ... adding additional objects ...
>Thanks anyway, problem solved, even when done in the __init__ of Queryset.
>Would manage_afterAdd a more sensible place for it?

You cannot do it in "__init__" when the object needs a correct
acquisition chain (which is not the case in "__init__").
This is the case, for example, when the object needs to be indexed.

When you add further objects in "manage_afterAdd", you have to be
aware, that "manage_afterAdd" is not only called when the object
is initially created but also for rename/move/copy. In all those cases,
your objects are likely to be already there. This means that you have
explicitely to check for this case.



-- 
Dieter


More information about the Zope mailing list