Changes between Version 10 and Version 11 of CookBookSplitModelsToFiles


Ignore:
Timestamp:
Jun 5, 2011, 2:43:47 PM (13 years ago)
Author:
hex```
Comment:

I tried with app_label instead of db_table and it didn't work. Took me 2 hours to figure this out, I hope it help someone.

Legend:

Unmodified
Added
Removed
Modified
  • CookBookSplitModelsToFiles

    v10 v11  
    33To split models across multiple files, you can do the following (works at least with revision 2819).
    44
    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.
     5The 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.
    66
    77'''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.
    88
    9 This has been verified to work without the Meta class app_labels, in the current main branch.
     9This has been verified to work without the Meta class db_table, in the current main branch.
    1010
    1111{{{apps/polls/models/__init__.py}}}:
     
    2626
    2727    class Meta:
    28         app_label = 'polls'
     28        db_table = 'polls'
    2929}}}
    3030
     
    4040
    4141    class Meta:
    42         app_label = 'polls'
     42        db_table = 'polls'
    4343}}}
    4444
Back to Top