1
0
mirror of https://github.com/django/django.git synced 2025-07-12 05:39:11 +00:00

[2.2.x] Fixed #30817 -- Clarified return value of Sitemap.items().

Backport of 7b3c06cd72e691ffd932ccce338701c37297a415 from master
This commit is contained in:
Sjbrgsn 2019-09-30 14:52:17 +02:00 committed by Mariusz Felisiak
parent 18df8484bd
commit da31472abf

View File

@ -116,11 +116,11 @@ Note:
attributes corresponding to ``<changefreq>`` and ``<priority>`` elements, attributes corresponding to ``<changefreq>`` and ``<priority>`` elements,
respectively. They can be made callable as functions, as respectively. They can be made callable as functions, as
:attr:`~Sitemap.lastmod` was in the example. :attr:`~Sitemap.lastmod` was in the example.
* :attr:`~Sitemap.items()` is simply a method that returns a list of * :attr:`~Sitemap.items()` is simply a method that returns a :term:`sequence`
objects. The objects returned will get passed to any callable methods or ``QuerySet`` of objects. The objects returned will get passed to any
corresponding to a sitemap property (:attr:`~Sitemap.location`, callable methods corresponding to a sitemap property
:attr:`~Sitemap.lastmod`, :attr:`~Sitemap.changefreq`, and (:attr:`~Sitemap.location`, :attr:`~Sitemap.lastmod`,
:attr:`~Sitemap.priority`). :attr:`~Sitemap.changefreq`, and :attr:`~Sitemap.priority`).
* :attr:`~Sitemap.lastmod` should return a :class:`~datetime.datetime`. * :attr:`~Sitemap.lastmod` should return a :class:`~datetime.datetime`.
* There is no :attr:`~Sitemap.location` method in this example, but you * There is no :attr:`~Sitemap.location` method in this example, but you
can provide it in order to specify the URL for your object. By default, can provide it in order to specify the URL for your object. By default,
@ -136,11 +136,11 @@ Note:
.. attribute:: Sitemap.items .. attribute:: Sitemap.items
**Required.** A method that returns a list of objects. The framework **Required.** A method that returns a :term:`sequence` or ``QuerySet``
doesn't care what *type* of objects they are; all that matters is that of objects. The framework doesn't care what *type* of objects they are;
these objects get passed to the :attr:`~Sitemap.location()`, all that matters is that these objects get passed to the
:attr:`~Sitemap.lastmod()`, :attr:`~Sitemap.changefreq()` and :attr:`~Sitemap.location()`, :attr:`~Sitemap.lastmod()`,
:attr:`~Sitemap.priority()` methods. :attr:`~Sitemap.changefreq()` and :attr:`~Sitemap.priority()` methods.
.. attribute:: Sitemap.location .. attribute:: Sitemap.location