On 2/2/06, Dan Jacob <[EMAIL PROTECTED]> wrote:
>
> You could do it like this:
>
> controllers.py > Root goes here, import other controllers
> model.py > your app-wide sqlobjects here, import other models
> forms.py > base form classes / widgets for whole app, non-module
> specific forms
>
> news/
>     controllers.py
>     model.py
>     forms.py
> forums/
>     controllers.py
>     model.py
>     ....
>
> One point is that you should (I think) import any models into your root
> model.py so that they can be handled by tg-admin sql commands.

I believe that does not work at present (though there is a ticket and
a suggested patch for SQLObject to enable that).

> I'm not sure about templates; they may need to go in a single
> directory, with subdirectories for each module.

At present, templates can go into any python package.

> As a side note, what would be really handy would be a tg-admin command
> like this:
>
> tg-admin createapp news
>
> which would create the required subdirectories, stub files, templates
> etc in the right places in your project.

You shouldn't have to do that kind of thing for using an existing app.
Ideally, once the egg is installed, you should be able to just import
the root of that other project and use it in yours. That ideal doesn't
yet exist and, looking more likely for now, you'll probably need to
just configure that other app in your config file.

Kevin

Reply via email to