Django

Code

Changeset 2778

Show
Ignore:
Timestamp:
04/28/06 20:14:56 (2 years ago)
Author:
adrian
Message:

magic-removal: Fixed #1700 -- Updated docs/generic_views.txt to reflect magic-removal. Thanks, Malcolm and asmodai

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/magic-removal/docs/generic_views.txt

    r2756 r2778  
    3636 
    3737    info_dict = { 
    38         'model': Entry
     38        'queryset': Entry.objects.all()
    3939        'date_field': 'pub_date', 
    4040    } 
     
    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 
     
    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  
    60 Most generic views require the ``model`` key, which is your model class (*not* 
    61 an instance of the class). 
     59``queryset``, ``date_field``, etc.). 
     60 
     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 
     
    447449            ``template_object_name`` is ``foo``, the variable will be ``foo`` 
    448450            instead of ``object``. 
     451