summaryrefslogtreecommitdiff
path: root/docs/generic_views.txt
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2006-06-01 04:21:26 +0000
committerAdrian Holovaty <adrian@holovaty.com>2006-06-01 04:21:26 +0000
commit5077f9ceafa650cc2af7be6de55769f45eb7939e (patch)
treec6ee5a395466706a8223357e26be962ec8feee44 /docs/generic_views.txt
parent5c5d60aa635fe90537e137c20d7619c03c30f12e (diff)
Fixed #697 -- Added make_object_list parameter to archive_year generic view. Thanks, jhf@hex.no
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3039 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/generic_views.txt')
-rw-r--r--docs/generic_views.txt23
1 files changed, 23 insertions, 0 deletions
diff --git a/docs/generic_views.txt b/docs/generic_views.txt
index 166ad8347d..317828a2b2 100644
--- a/docs/generic_views.txt
+++ b/docs/generic_views.txt
@@ -250,6 +250,18 @@ with a date in the *future* are not displayed.
* ``context_processors``: A list of template-context processors to apply to
the view's template. See the `RequestContext docs`_.
+ * ``template_object_name``: Designates the name of the template variable
+ to use in the template context. By default, this is ``'object'``. The
+ view will append ``'_list'`` to the value of this parameter in
+ determining the variable's name.
+
+ * ``make_object_list``: A boolean specifying whether to retrieve the full
+ list of objects for this year and pass those to the template. If ``True``,
+ this list of objects will be made available to the template as
+ ``object_list``. (The name ``object_list`` may be different; see the docs
+ for ``object_list`` in the "Template context" section below.) By default,
+ this is ``False``.
+
* ``mimetype``: The MIME type to use for the resulting document. Defaults
to the value of the ``DEFAULT_MIME_TYPE`` setting.
@@ -265,8 +277,19 @@ In addition to ``extra_context``, the template's context will be:
* ``date_list``: A list of ``datetime.date`` objects representing all
months that have objects available in the given year, according to
``queryset``, in ascending order.
+
* ``year``: The given year, as a four-character string.
+ * ``object_list``: If the ``make_object_list`` parameter is ``True``, this
+ will be set to a list of objects available for the given year, ordered by
+ the date field. This variable's name depends on the
+ ``template_object_name`` parameter, which is ``'object'`` by default. If
+ ``template_object_name`` is ``'foo'``, this variable's name will be
+ ``foo_list``.
+
+ If ``make_object_list`` is ``False``, ``object_list`` will be passed to
+ the template as an empty list.
+
``django.views.generic.date_based.archive_month``
-------------------------------------------------