[Zope-CMF] how to get the object created by invokeFactory
Chris Withers
chrisw@nipltd.com
Tue, 03 Jul 2001 15:03:37 +0100
seb bacon wrote:
>
> Really? It's a useful feature, and it only takes a couple of lines of
> code (some keyword arguments in the class constructor, and the factory
> method). It should stay, IMO - I use it a bit. Why would you *not*
> want it?
Because it leads to lots of unneccessary code duplication, which means an
increased chance of bugs...
What you really want is a constructor that does nothing but build the object and
an edit methdo which fills in all the details.
That way, you don't have 'editing' code in both the __init__ and edit methods.
cheers,
Chris