Changes between Version 8 and Version 9 of MagicRemovalCheatSheet
- Timestamp:
- May 11, 2006, 11:59:14 PM (19 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
MagicRemovalCheatSheet
v8 v9 45 45 1. [wiki:RemovingTheMagic#Interactdirectlywithmodelclassesnotwithmagicmodules Import your models directly] the Python way. For example, if your model {{{Person}}} is in {{{yourproject/yourapp/models.py}}} file, use: 46 46 {{{ 47 #!python 47 48 from yourproject.yourapp.models import Person 48 49 }}} … … 57 58 1. A former module {{{settings}}} is an instance now. [wiki:RemovingTheMagic#Movedsettingsintoaninstance Import it] using: 58 59 {{{ 60 #!python 59 61 from django.conf import settings 60 62 }}} … … 95 97 1. [wiki:RemovingTheMagic#Changedtheparametersyoupasstogenericviews Change the parameters you pass to generic views]: remove {{{app_label}}} and {{{model_name}}}, add {{{queryset}}}. 96 98 1. Update {{{settings.py}}}: 97 1. Update {{{TEMPLATE_LOADERS}}} to reflect [wiki:RemovingTheMagic#Namespacesimplification Namespace simplification]: remove {{{core}} from their names. 99 1. Update {{{TEMPLATE_LOADERS}}} to reflect [wiki:RemovingTheMagic#Namespacesimplification Namespace simplification]: remove {{{core}}} from their names. 100 1. If you moved templates to {{{yourapp}}} directory (see the [wiki:MagicRemovalCheatSheet#Templates Templates section]), make sure your {{{TEMPLATE_LOADERS}}} variable includes {{{django.template.loaders.app_directories.load_template_source}}}. 98 101 1. Update {{{INSTALLED_APPS}}} to reflect [wiki:RemovingTheMagic#Namespacesimplification Namespace simplification]: 99 102 * {{{django.models.auth}}} => {{{django.contrib.auth.models}}}