← Back to team overview

oship-dev team mailing list archive

Re: OSHIP Rev 224 Code Review: issue #02 - Replace the view Setup() in app.py

 

on 29-3-2009 0:18 Tim Cook wrote:
On Sat, 2009-03-28 at 13:58 +0100, Roger Erens wrote:
I think (from the examples I have read)
Do you have some pointers to them examples?

that an __init__ method may not
do what you expect.  The developer that takes on this issue will have to
do some in depth reading and experimentation.
Maybe it's the need to call the super(Oship, self).__init__()-method from within __init__(self) that's important to remember.



I think you may be looking for the update method.  Seems to me it is
called by Grok before anything else happens.



AFAIK, the update() method exists only for grok.View derived classes. It is indeed called before doing the rendering of the View.

I think one should not create containers or do other application logic in Views. That should be done in grok.Application/Model/Container derived classes/objects.

In particular, when creating the (singleton) Oship application, creating the containers for the archetype repository and terminal server/service are one-time actions. Therefore, to me the __init__() method still looks like a very good candidate to contain those statements.

Cheers,

Roger



References