Collin Klopfenstein Collin Klopfenstein - 9 months ago 55
Python Question

Separating Models and Request Handlers In Google App Engine

I'd like to move my models to a separate directory, similar to the way it's done with Rails to cut down on code clutter. Is there any way to do this easily?


123 123
Answer Source

I assume you're using the basic webkit and not Django or something fancy. In that case just create a subdirectory called models. Put any python files you use for your models in here. Create also one blank file in this folder called

Then in your or "controller" or what have you, put:

import models

at the top.

You just created a python package.