Changes between Version 10 and Version 11 of CookBookSplitModelsToFiles
- Timestamp:
- Jun 5, 2011, 2:43:47 PM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
CookBookSplitModelsToFiles
v10 v11 3 3 To split models across multiple files, you can do the following (works at least with revision 2819). 4 4 5 The important thing to notice here is the {{{ app_label}}} attribute in the {{{Meta}}} class. If that is omitted, a subsequent {{{manage.py syncdb}}} run will not pick up these models.5 The important thing to notice here is the {{{db_table}}} attribute in the {{{Meta}}} class. If that is omitted, a subsequent {{{manage.py syncdb}}} run will not pick up these models. 6 6 7 7 '''NOTE:''' When #3591 gets applied you won't need the {{{Meta}}} class anymore, so if this link: #3591 has a strike-through and you are running svn, you don't need the {{{Meta}}} class. 8 8 9 This has been verified to work without the Meta class app_labels, in the current main branch.9 This has been verified to work without the Meta class db_table, in the current main branch. 10 10 11 11 {{{apps/polls/models/__init__.py}}}: … … 26 26 27 27 class Meta: 28 app_label= 'polls'28 db_table = 'polls' 29 29 }}} 30 30 … … 40 40 41 41 class Meta: 42 app_label= 'polls'42 db_table = 'polls' 43 43 }}} 44 44