[Zope-dev] Product construction question
Florent Guillaume
fg@nuxeo.com
Thu, 19 Sep 2002 23:50:38 +0000 (UTC)
> def addPF(self, id=None, title=None, usercontract=None):
> """
> Create a portfolio
> """
>
> if not id:
> id = uuidgen()
> p = PF(id, title, usercontract)
> self.Destination()._setObject(id, p)
> # create an account
> p.addAccount(id='account', valuta='EUR')
> p.manage_addFolder(id='KKK')
> return id
Do not call the first argument "self" if it is not a real method self.
Here it should probably be called "dispatcher"
> 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
Same comment.
Have you read the Developer's Guide? It talks about product creation and
should answer your questions.
Florent
--
Florent Guillaume, Nuxeo (Paris, France)
+33 1 40 33 79 87 http://nuxeo.com mailto:fg@nuxeo.com