summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2014-12-08 01:21:07 +0200
committerTim Graham <timograham@gmail.com>2014-12-15 09:45:31 -0500
commit9aeb917dad2c3d4c2830f38d3bfc63699e0ba837 (patch)
tree564b305a273149e493b987835cd4ef5deffb1fd4 /docs
parentaa5ef0d4fc67a95ac2a5103810d0c87d8c547bac (diff)
Fixed #23884 -- Moved FlatPageSitemap into django.contrib.flatpages.
Diffstat (limited to 'docs')
-rw-r--r--docs/internals/deprecation.txt3
-rw-r--r--docs/ref/contrib/flatpages.txt40
-rw-r--r--docs/ref/contrib/sitemaps.txt17
-rw-r--r--docs/releases/1.8.txt7
4 files changed, 59 insertions, 8 deletions
diff --git a/docs/internals/deprecation.txt b/docs/internals/deprecation.txt
index 15fbed1565..54d86cbf23 100644
--- a/docs/internals/deprecation.txt
+++ b/docs/internals/deprecation.txt
@@ -222,6 +222,9 @@ details on these changes.
:attr:`RedirectView.permanent <django.views.generic.base.RedirectView.permanent>`
attribute will change from ``True`` to ``False``.
+* ``django.contrib.sitemaps.FlatPageSitemap`` will be removed in favor of
+ ``django.contrib.flatpages.sitemaps.FlatPageSitemap``.
+
.. _deprecation-removed-in-1.8:
1.8
diff --git a/docs/ref/contrib/flatpages.txt b/docs/ref/contrib/flatpages.txt
index b280e0ddc4..a40e912bd8 100644
--- a/docs/ref/contrib/flatpages.txt
+++ b/docs/ref/contrib/flatpages.txt
@@ -293,3 +293,43 @@ For example:
{% get_flatpages '/about/' as about_pages %}
{% get_flatpages about_prefix as about_pages %}
{% get_flatpages '/about/' for someuser as about_pages %}
+
+Integrating with :mod:`django.contrib.sitemaps`
+===============================================
+
+.. currentmodule:: django.contrib.flatpages.sitemaps
+
+.. class:: FlatPageSitemap
+
+ The :class:`sitemaps.FlatPageSitemap
+ <django.contrib.flatpages.sitemaps.FlatPageSitemap>` class looks at all
+ publicly visible :mod:`~django.contrib.flatpages` defined for the current
+ :setting:`SITE_ID` (see the :mod:`sites documentation
+ <django.contrib.sites>`) and creates an entry in the sitemap. These entries
+ include only the :attr:`~django.contrib.sitemaps.Sitemap.location`
+ attribute -- not :attr:`~django.contrib.sitemaps.Sitemap.lastmod`,
+ :attr:`~django.contrib.sitemaps.Sitemap.changefreq` or
+ :attr:`~django.contrib.sitemaps.Sitemap.priority`.
+
+ .. versionchanged:: 1.8
+
+ This class is available from ``django.contrib.sitemaps.FlatPageSitemap``
+ in older version of Django.
+
+Example
+-------
+
+Here's an example of a URLconf using :class:`FlatPageSitemap`::
+
+ from django.conf.urls import url
+ from django.contrib.flatpages.sitemaps import FlatPageSitemap
+ from django.contrib.sitemaps.views import sitemap
+
+ urlpatterns = [
+ # ...
+
+ # the sitemap
+ url(r'^sitemap\.xml$', sitemap,
+ {'sitemaps': {'flatpages': FlatPageSitemap}},
+ name='django.contrib.sitemaps.views.sitemap'),
+ ]
diff --git a/docs/ref/contrib/sitemaps.txt b/docs/ref/contrib/sitemaps.txt
index 5902a131a3..8279d8e93e 100644
--- a/docs/ref/contrib/sitemaps.txt
+++ b/docs/ref/contrib/sitemaps.txt
@@ -251,6 +251,10 @@ The sitemap framework provides a couple convenience classes for common cases:
.. class:: FlatPageSitemap
+ .. deprecated:: 1.8
+
+ Use :class:`django.contrib.flatpages.sitemaps.FlatPageSitemap` instead.
+
The :class:`django.contrib.sitemaps.FlatPageSitemap` class looks at all
publicly visible :mod:`flatpages <django.contrib.flatpages>`
defined for the current :setting:`SITE_ID` (see the
@@ -275,10 +279,11 @@ The sitemap framework provides a couple convenience classes for common cases:
Example
-------
-Here's an example of a :doc:`URLconf </topics/http/urls>` using both::
+Here's an example of a :doc:`URLconf </topics/http/urls>` using
+:class:`GenericSitemap`::
from django.conf.urls import url
- from django.contrib.sitemaps import FlatPageSitemap, GenericSitemap
+ from django.contrib.sitemaps import GenericSitemap
from django.contrib.sitemaps.views import sitemap
from blog.models import Entry
@@ -287,17 +292,13 @@ Here's an example of a :doc:`URLconf </topics/http/urls>` using both::
'date_field': 'pub_date',
}
- sitemaps = {
- 'flatpages': FlatPageSitemap,
- 'blog': GenericSitemap(info_dict, priority=0.6),
- }
-
urlpatterns = [
# some generic view using info_dict
# ...
# the sitemap
- url(r'^sitemap\.xml$', sitemap, {'sitemaps': sitemaps},
+ url(r'^sitemap\.xml$', sitemap,
+ {'sitemaps': {'blog': GenericSitemap(info_dict, priority=0.6)}},
name='django.contrib.sitemaps.views.sitemap'),
]
diff --git a/docs/releases/1.8.txt b/docs/releases/1.8.txt
index 0637bdc206..5b4d8d2df3 100644
--- a/docs/releases/1.8.txt
+++ b/docs/releases/1.8.txt
@@ -1204,6 +1204,13 @@ In Django 2.0, session verification will be enabled regardless of whether or not
to your ``MIDDLEWARE_CLASSES`` sometime before then to opt-in. Please read the
:ref:`upgrade considerations <session-invalidation-on-password-change>` first.
+``django.contrib.sitemaps.FlatPageSitemap``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+``django.contrib.sitemaps.FlatPageSitemap`` has moved to
+``django.contrib.flatpages.sitemaps.FlatPageSitemap``. The old import location
+is deprecated and will be removed in Django 1.9.
+
.. removed-features-1.8:
Features removed in 1.8