~ubuntu-branches/ubuntu/oneiric/python-django/oneiric

« back to all changes in this revision

Viewing changes to docs/ref/generic-views.txt

  • Committer: Bazaar Package Importer
  • Author(s): Jamie Strandboge
  • Date: 2011-02-17 13:34:07 UTC
  • mfrom: (1.1.13 upstream) (4.4.12 sid)
  • Revision ID: james.westby@ubuntu.com-20110217133407-rwr88elhhq6j7ba0
Tags: 1.2.5-1ubuntu1
* Merge from Debian for security fixes (LP: #719031). Remaining changes:
  - debian/control: don't Build-Depends on locales-all, which doesn't exist
    in natty
* Drop the following patches, now included upstream:
  - debian/patches/07_security_admin_infoleak.diff
  - debian/patches/08_security_pasword_reset_dos.diff

Show diffs side-by-side

added added

removed removed

Lines of Context:
176
176
      specified in ``date_field`` is greater than the current date/time. By
177
177
      default, this is ``False``.
178
178
 
179
 
    .. versionadded:: 1.0
180
 
 
181
179
    * ``template_object_name``: Designates the name of the template variable
182
180
      to use in the template context. By default, this is ``'latest'``.
183
181
 
197
195
 
198
196
In addition to ``extra_context``, the template's context will be:
199
197
 
200
 
    * ``date_list``: A list of ``datetime.date`` objects representing all
201
 
      years that have objects available according to ``queryset``. These are
202
 
      ordered in reverse. This is equivalent to
203
 
      ``queryset.dates(date_field, 'year')[::-1]``.
204
 
 
205
 
    .. versionchanged:: 1.0
206
 
       The behaviour depending on ``template_object_name`` is new in this version.
 
198
    * ``date_list``: A ``DateQuerySet`` object containing all years that have
 
199
      have objects available according to ``queryset``, represented as
 
200
      ``datetime.datetime`` objects. These are ordered in reverse. This is
 
201
      equivalent to ``queryset.dates(date_field, 'year')[::-1]``.
207
202
 
208
203
    * ``latest``: The ``num_latest`` objects in the system, ordered descending
209
204
      by ``date_field``. For example, if ``num_latest`` is ``10``, then
282
277
 
283
278
In addition to ``extra_context``, the template's context will be:
284
279
 
285
 
    * ``date_list``: A list of ``datetime.date`` objects representing all
286
 
      months that have objects available in the given year, according to
287
 
      ``queryset``, in ascending order.
 
280
    * ``date_list``: A ``DateQuerySet`` object containing all months that have
 
281
      have objects available according to ``queryset``, represented as
 
282
      ``datetime.datetime`` objects, in ascending order.
288
283
 
289
284
    * ``year``: The given year, as a four-character string.
290
285
 
372
367
 
373
368
In addition to ``extra_context``, the template's context will be:
374
369
 
375
 
    * ``date_list``: A list of ``datetime.date`` objects representing all
376
 
      days that have objects available in the given month, according to
377
 
      ``queryset``, in ascending order.    
 
370
    * ``date_list``: A ``DateQuerySet`` object containing all days that have
 
371
      have objects available in the given month, according to ``queryset``,
 
372
      represented as ``datetime.datetime`` objects, in ascending order.
378
373
 
379
374
    * ``month``: A ``datetime.date`` object representing the given month.
380
375
 
721
716
 
722
717
**Template context:**
723
718
 
724
 
.. versionadded:: 1.0
725
 
   The ``paginator`` and ``page_obj`` context variables are new.
726
 
 
727
719
In addition to ``extra_context``, the template's context will be:
728
720
 
729
721
    * ``object_list``: The list of objects. This variable's name depends on the
767
759
For more on pagination, read the :doc:`pagination documentation
768
760
</topics/pagination>`.
769
761
 
770
 
.. versionadded:: 1.0
771
 
 
772
762
As a special case, you are also permitted to use ``last`` as a value for
773
763
``page``::
774
764
 
853
843
The ``django.views.generic.create_update`` module contains a set of functions
854
844
for creating, editing and deleting objects.
855
845
 
856
 
.. versionchanged:: 1.0
857
 
 
858
846
``django.views.generic.create_update.create_object`` and
859
847
``django.views.generic.create_update.update_object`` now use the new :doc:`forms
860
848
library </topics/forms/index>` to build and display the form.