Ticket #1700: generic_views.txt.diff

File generic_views.txt.diff, 1.9 KB (added by Malcolm Tredinnick <malcolm@…>, 19 years ago)

Bring generic_views.txt up to date with amgic-removal changes

  • docs/generic_views.txt

     
    3535    from django_website.apps.blog.models import Entry
    3636
    3737    info_dict = {
    38         'model': Entry,
     38        'queryset': Entry.objects.all(),
    3939        'date_field': 'pub_date',
    4040    }
    4141
     
    4747       (r'^/?$',                                                                  'archive_index', info_dict),
    4848    )
    4949
    50 As you can see, this URLconf defines a few options in ``info_dict``. ``'model'``
    51 tells the generic view which model to use (``Entry``, in this case), as well as
    52 some extra information.
     50As you can see, this URLconf defines a few options in ``info_dict``.
     51``'queryset'`` tells the generic view which objects to use (all of the
     52``Entry`` objects, in this case), as well as some extra information (it is
     53used by the view to determine the model being used, for example).
    5354
    5455Documentation of each generic view follows, along with a list of all keyword
    5556arguments that a generic view expects. Remember that as in the example above,
    5657arguments may either come from the URL pattern (as ``month``, ``day``,
    5758``year``, etc. do above) or from the additional-information dictionary (as for
    58 ``model``, ``date_field``, etc.).
     59``queryset``, ``date_field``, etc.).
    5960
    60 Most generic views require the ``model`` key, which is your model class (*not*
    61 an instance of the class).
     61Most generic views require the ``queryset`` key, which is a ``QuerySet``
     62instance (*not* an instance of the class); see the `database API docs`_
     63for more information about query sets.
    6264
    6365Using "simple" generic views
    6466============================
     
    446448            ``template_object_name`` parameter. (See above.) For example, if
    447449            ``template_object_name`` is ``foo``, the variable will be ``foo``
    448450            instead of ``object``.
     451
Back to Top