[Zope] adding product-based objects programmatically

Kees de Brabander cj.de.brabander at hccnet.nl
Thu Aug 3 14:39:08 EDT 2006


----- Original Message ----- 
From: "Dieter Maurer" <dieter at handshake.de>
To: "Kees de Brabander" <cj.de.brabander at hccnet.nl>
Cc: "Jens Vagelpohl" <jens at dataflake.org>; "[Zope] Mailing List"
<zope at zope.org>
Sent: Thursday, August 03, 2006 7:04 PM
Subject: Re: [Zope] adding product-based objects programmatically


> Kees de Brabander wrote at 2006-8-3 16:25 +0200:
> >Huh? I included the relevant portions of my source code in my message:
> >
> >Module QuerySet.py:
> >from Query import manage_addQuery
> >class QuerySet(Folder):
> >    def __init__(self, id, title):
> >        self.id = id
> >        self.title = title
> >        self.manage_addUserFolder()
> >
> >    def manage_afterAdd(self, item, container):
> >        manage_addQuery(self, id, title)
> >
> >manage_addQuery in Query.py looks like:
> >def manage_addQuery(dispatcher, id, title, REQUEST=None):
> >    "...."
> >    nQ=Query(id,title)
> >    dispatcher.Destination()._setObject(id, nQ)
>
> Apparently, "dispatcher" lacks a "Destination" method.
>
> Why are you using it?
> Usually "dispatcher._setObject" is enough.

I must confess that I copied it from an example (don't know which anymore).
Thanks anyway, problem solved, even when done in the __init__ of Queryset.
Would manage_afterAdd a more sensible place for it?

cb



More information about the Zope mailing list