Changes between Version 36 and Version 37 of RemovingTheMagic


Ignore:
Timestamp:
Jan 12, 2006, 9:30:52 PM (19 years ago)
Author:
Adrian Holovaty
Comment:

Added notes about generic views

Legend:

Unmodified
Added
Removed
Modified
  • RemovingTheMagic

    v36 v37  
    387387Also, the {{{Session}}} model has moved from django/models/core.py to django/contrib/sessions/models.py. If you're accessing the {{{Session}}} model for some reason, note that location change.
    388388
     389== Changed the parameters you pass to generic views ==
     390
     391'''Status: Done'''
     392
     393Because there's no longer a concept of {{{module_name}}}, the "info_dicts" passed to [http://www.djangoproject.com/documentation/generic_views/ generic views] no longer accept {{{"app_label"}}} and {{{"module_name"}}}. Instead, pass the parameter {{{"model"}}}, which should be your model class.
     394
     395These examples assume models live in {{{myproject/blog/models.py}}}.
     396
     397Old:
     398{{{
     399#!python
     400info_dict = {
     401    'app_label': 'blog',
     402    'module_name': 'entries'
     403}
     404}}}
     405
     406New:
     407{{{
     408#!python
     409from myproject.blog.models import Entry
     410info_dict = {
     411    'model': Entry
     412}
     413}}}
     414
     415== Changed template names in generic views ==
     416
     417'''Status: Done'''
     418
     419Because there's no longer a concept of {{{module_name}}}, [http://www.djangoproject.com/documentation/generic_views/ generic views] no longer create templates based on the {{{module_name}}}. Wherever they used {{{module_name}}}, they now use {{{model_name}}}, a lowercase version of the model name.
     420
     421Note that {{{app_label}}} remains the same.
     422
     423These examples assume models live in {{{myproject/blog/models.py}}}.
     424
     425 * Old: {{{blog/entries_archive.html}}}
     426 * New: {{{blog/entry_archive.html}}}
     427
    389428== Change subclassing syntax ==
    390429
Back to Top