Changes between Version 13 and Version 14 of DataModelPitfalls


Ignore:
Timestamp:
04/03/2006 06:24:08 AM (9 years ago)
Author:
ejf-django@…
Comment:

putting underscored names in code blocks

Legend:

Unmodified
Added
Removed
Modified
  • DataModelPitfalls

    v13 v14  
    7171If you have a model class (for example Choices) that has a !ForeignKey, the class that is the foreign key (for example Polls) gets methods like get_X_list, get_X_count (for example, Polls.get_choice_list, Polls.get_choice_count).
    7272
    73 However, if you find those are not getting created, and you have a multi-file model, check to make sure that you have updated the __all__ variable in your model's __init__.py.  It can be tough to remember to update that with the list of all your files in your model.  If a particular model file isn't in __all__, those methods won't get created in your model objects.
     73However, if you find those are not getting created, and you have a multi-file model, check to make sure that you have updated the {{{__all__}}} variable in your model's {{{__init__.py}}}.  It can be tough to remember to update that with the list of all your files in your model.  If a particular model file isn't in {{{__all__}}}, those methods won't get created in your model objects.
Back to Top