| 389 | == Changed the parameters you pass to generic views == |
| 390 | |
| 391 | '''Status: Done''' |
| 392 | |
| 393 | Because 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 | |
| 395 | These examples assume models live in {{{myproject/blog/models.py}}}. |
| 396 | |
| 397 | Old: |
| 398 | {{{ |
| 399 | #!python |
| 400 | info_dict = { |
| 401 | 'app_label': 'blog', |
| 402 | 'module_name': 'entries' |
| 403 | } |
| 404 | }}} |
| 405 | |
| 406 | New: |
| 407 | {{{ |
| 408 | #!python |
| 409 | from myproject.blog.models import Entry |
| 410 | info_dict = { |
| 411 | 'model': Entry |
| 412 | } |
| 413 | }}} |
| 414 | |
| 415 | == Changed template names in generic views == |
| 416 | |
| 417 | '''Status: Done''' |
| 418 | |
| 419 | Because 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 | |
| 421 | Note that {{{app_label}}} remains the same. |
| 422 | |
| 423 | These examples assume models live in {{{myproject/blog/models.py}}}. |
| 424 | |
| 425 | * Old: {{{blog/entries_archive.html}}} |
| 426 | * New: {{{blog/entry_archive.html}}} |
| 427 | |