[Grok-dev] Initializing an app and module structure

Jeroen Michiel jmichiel at yahoo.com
Fri Jan 16 09:12:07 EST 2009


Hi,

I'm trying to get a Grok app going, but I'm having a bit of trouble knowing
what to put where.
First of all, what is the best way to 'prepare an app': My app relies on
some containers to exist within the app container. How do you take care of
them being created?
I tried with an __init__() for my App class, but that only gets invoked if
you create your app (which is not that bad a thing), but it requires the app
to know all the classes for the subcontainers, but that leads to mutual
imports...

That leads us to my second problem: what is the best way to divide your app
in submodules?
What I had in mind way make a submodule per Model, and put all views and
viewlets for that model in there, as well as the container for that module.
As my viewlets need to register to a viewletmanager which I defined in the
main app.py, I would get a mutual import. I solved this by putting the
container class definitions in the main app.py, but it feels wrong...

How do you guys generally structure a large app, or am I completely missing
the point, here?
Any help appreciated!
-- 
View this message in context: http://www.nabble.com/Initializing-an-app-and-module-structure-tp21500148p21500148.html
Sent from the Grok mailing list archive at Nabble.com.



More information about the Grok-dev mailing list