Posted By

myoffe on 03/01/11


Tagged

django


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

myoffe


Splitting up Django models


 / Published in: Python
 

URL: http://recursive-design.com/blog/2006/12/31/splitting-up-django-models/

  1. # 1. Create a models folder under myApp.
  2.  
  3. # 2. Delete models.py and add a model_name.py file in the models folder for each model model_name.
  4.  
  5. # 3. Add the following to each model file :
  6.  
  7. class Meta:
  8. app_label = 'myApp'
  9.  
  10. # 4. Add a line in models/_init__.py_ for each model file :
  11.  
  12. from myModelFile import myModel

Report this snippet  

You need to login to post a comment.