[Zope-dev] Product construction question
Dieter Maurer
dieter@handshake.de
Thu, 19 Sep 2002 19:59:53 +0200
Joost van Lawick writes:
> ...
> def addAccount(self, id=None, title=None, valuta=None):
> """
> Create an user Account
> """
>
> if not id:
> id = uuidgen()
> p = Account(id, title, valuta)
> 1: #self.Destination()._setObject(id, p)
> 2: self._setObject(id, p)
> return id
>
> When I comment in line 1 and leave out line 2, I get an Attribute Error on
> Destination. When line 1 is commented out and 2 goes in: Voila!
> I can still create Account objects in the ZMI.
>
> So what does the Destination() method do in construction of an
> object?
"Destination" is a method of "FactoryDispatcher"s, the kind of
thing returned by
"manage_addProduct[product_name]"
Apparently, you call "addAccount" with a "self" that is not
a "FactoryDispatcher".
Dieter