Collin Klopfenstein Collin Klopfenstein - 17 days ago 6
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?

Thanks,
Collin

123 123
Answer

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 __init__.py.

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

import models

at the top.

You just created a python package.

Comments