summaryrefslogtreecommitdiff
path: root/docs/generic_views.txt
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2007-09-15 21:34:09 +0000
committerAdrian Holovaty <adrian@holovaty.com>2007-09-15 21:34:09 +0000
commitbf6a46d8ad11d49990a3878166cce2af2fc6c4fe (patch)
treeb24514e1780e8ec80afb9f295005e196af460f15 /docs/generic_views.txt
parentfb6a0c8ffa1cd74c63aaf4b011665e5952d449e7 (diff)
queryset-refactor: Merged to [6190]
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6334 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/generic_views.txt')
-rw-r--r--docs/generic_views.txt20
1 files changed, 17 insertions, 3 deletions
diff --git a/docs/generic_views.txt b/docs/generic_views.txt
index 33c39b7e12..a00a49d8be 100644
--- a/docs/generic_views.txt
+++ b/docs/generic_views.txt
@@ -201,6 +201,10 @@ a date in the *future* are not included unless you set ``allow_future`` to
specified in ``date_field`` is greater than the current date/time. By
default, this is ``False``.
+ * **New in Django development version:** ``template_object_name``:
+ Designates the name of the template variable to use in the template
+ context. By default, this is ``'latest'``.
+
**Template name:**
If ``template_name`` isn't specified, this view will use the template
@@ -221,10 +225,16 @@ In addition to ``extra_context``, the template's context will be:
years that have objects available according to ``queryset``. These are
ordered in reverse. This is equivalent to
``queryset.dates(date_field, 'year')[::-1]``.
+
* ``latest``: The ``num_latest`` objects in the system, ordered descending
by ``date_field``. For example, if ``num_latest`` is ``10``, then
``latest`` will be a list of the latest 10 objects in ``queryset``.
+ **New in Django development version:** This variable's name depends on
+ the ``template_object_name`` parameter, which is ``'latest'`` by default.
+ If ``template_object_name`` is ``'foo'``, this variable's name will be
+ ``foo``.
+
.. _RequestContext docs: ../templates_python/#subclassing-context-requestcontext
``django.views.generic.date_based.archive_year``
@@ -764,8 +774,8 @@ If the results are paginated, the context will contain these extra variables:
* ``hits``: The total number of objects across *all* pages, not just this
page.
- * ``page_range``: A list of the page numbers that are available. This
- is 1-based.
+ * **New in Django development version:** ``page_range``: A list of the
+ page numbers that are available. This is 1-based.
Notes on pagination
~~~~~~~~~~~~~~~~~~~
@@ -788,7 +798,11 @@ specify the page number in the URL in one of two ways:
to create a link to every page of results.
These values and lists are is 1-based, not 0-based, so the first page would be
-represented as page ``1``. As a special case, you are also permitted to use
+represented as page ``1``.
+
+**New in Django development version:**
+
+As a special case, you are also permitted to use
``last`` as a value for ``page``::
/objects/?page=last