Author's Bio: Anton Mamaenko

Wednesday, December 9, 2009

Placing django models in different files

The models in Django app, as well as views, by the way, are the backbone of the system. It is obvious that there will be number of classes, and it is unwise to put them all into a single file. However, by default Django promotes this weird approach. Furthermore, it is not obvious how to actually y make it work - simply put a
import *
statement , or something like that into the models.py is not working, Django dbsync procedure would spit out errors. Thanks to Chris Petrilli - here is an article of how to solve this problem: http://blog.amber.org/2009/01/19/moving-django-models-into-their-own-module/

No comments:

Post a Comment

Search This Blog