Changeset 6157
- Timestamp:
- 09/13/07 22:54:28 (1 year ago)
- Files:
-
- django/trunk/django/views/generic/date_based.py (modified) (2 diffs)
- django/trunk/docs/generic_views.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/views/generic/date_based.py
r6058 r6157 11 11 template_name=None, template_loader=loader, 12 12 extra_context=None, allow_empty=False, context_processors=None, 13 mimetype=None, allow_future=False ):13 mimetype=None, allow_future=False, template_object_name='latest'): 14 14 """ 15 15 Generic top-level archive of date-based objects. … … 40 40 c = RequestContext(request, { 41 41 'date_list' : date_list, 42 'latest': latest,42 template_object_name : latest, 43 43 }, context_processors) 44 44 for key, value in extra_context.items(): django/trunk/docs/generic_views.txt
r6149 r6157 202 202 default, this is ``False``. 203 203 204 * ``template_object_name``: Designates the name of the template variable 205 to use in the template context. By default, this is ``'latest'``. 206 204 207 **Template name:** 205 208 … … 222 225 ordered in reverse. This is equivalent to 223 226 ``queryset.dates(date_field, 'year')[::-1]``. 227 224 228 * ``latest``: The ``num_latest`` objects in the system, ordered descending 225 229 by ``date_field``. For example, if ``num_latest`` is ``10``, then 226 ``latest`` will be a list of the latest 10 objects in ``queryset``. 230 ``latest`` will be a list of the latest 10 objects in ``queryset``. This 231 variable's name depends on the ``template_object_name`` parameter, which 232 is ``'latest'`` by default. If ``template_object_name`` is ``'foo'``, 233 this variable's name will be ``foo``. 227 234 228 235 .. _RequestContext docs: ../templates_python/#subclassing-context-requestcontext
