[Grok-dev] class-level versus instance-level attributes for schema

Christian Theune ct at gocept.com
Fri Oct 20 07:23:13 EDT 2006


Martijn Faassen wrote:
> Philipp von Weitershausen wrote:
>> Why don't me make that the default grok.Model.__init__? In the rare
>> case that people need to do their own initialization, they can choose
>> to use super() (or not).
> That sounds like a reasonable strategy, though I'd like to explore some
> alternatives:
> An alternative would be to have a separate SchemaModel object and do it
> in the __init__ there, but another source of confusion could arise:
> people using class fields on a non-schema model and having it not working.
> What we could also do is create an __init__ based on the form, but only
> poke it in if the grok.Model is not defining one itself. That might be
> too magic however.

Doing super() is the Python way to deal with inheritance. I'd be ok to
do that.


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/20061020/17d829a7/signature.bin

More information about the Grok-dev mailing list