[Grok-dev] it is really necessary to use __new__?

Christian Theune ct at gocept.com
Thu Oct 19 11:13:43 EDT 2006



Philipp von Weitershausen wrote:
> Martijn Faassen wrote:
>> Hi there,
>>
>> I think it'd be a valuable if we could keep grok base classes as free
>> of magic as we can. Instead, our magic should be done during grokking.
>> Therefore I'm asking whether it's really necessary to add a __new__ to
>> grok.Model? Couldn't it pull out the fields during grok time?
> 
> It's not setting fields, it's setting default values (None) on the
> instance. Apart from the question whether something could be done at
> grok time or not, I wonder why it does that. It's not necessary for
> instances to have the attributes that are edited in an EditForm.

It's not? I always encountered formlib to fail on editforms if the
instance doesn't have the attributes.  And so did Wolfgang.

Christian

-- 
gocept gmbh & co. kg - forsterstraße 29 - 06112 halle/saale - germany
www.gocept.com - ct at gocept.com - phone +49 345 122 9889 7 -
fax +49 345 122 9889 1 - zope and plone consulting and development


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
Url : http://mail.zope.org/pipermail/grok-dev/attachments/20061019/3d698bfd/signature.bin


More information about the Grok-dev mailing list