Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
9f21e351
Kaydet (Commit)
9f21e351
authored
Şub 15, 2017
tarafından
Alexey Opalev
Kaydeden (comit)
Tim Graham
Şub 28, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #27842 -- Added protocol kwarg to GenericSitemap.__init__().
üst
81957086
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
7 deletions
+16
-7
__init__.py
django/contrib/sitemaps/__init__.py
+2
-1
sitemaps.txt
docs/ref/contrib/sitemaps.txt
+10
-5
2.0.txt
docs/releases/2.0.txt
+2
-1
test_generic.py
tests/sitemaps_tests/test_generic.py
+2
-0
No files found.
django/contrib/sitemaps/__init__.py
Dosyayı görüntüle @
9f21e351
...
...
@@ -142,11 +142,12 @@ class GenericSitemap(Sitemap):
priority
=
None
changefreq
=
None
def
__init__
(
self
,
info_dict
,
priority
=
None
,
changefreq
=
None
):
def
__init__
(
self
,
info_dict
,
priority
=
None
,
changefreq
=
None
,
protocol
=
None
):
self
.
queryset
=
info_dict
[
'queryset'
]
self
.
date_field
=
info_dict
.
get
(
'date_field'
)
self
.
priority
=
priority
self
.
changefreq
=
changefreq
self
.
protocol
=
protocol
def
items
(
self
):
# Make sure to return a clone; we don't want premature evaluation.
...
...
docs/ref/contrib/sitemaps.txt
Dosyayı görüntüle @
9f21e351
...
...
@@ -259,7 +259,7 @@ Shortcuts
The sitemap framework provides a convenience class for a common case:
.. class:: GenericSitemap
.. class:: GenericSitemap
(info_dict, priority=None, changefreq=None, protocol=None)
The :class:`django.contrib.sitemaps.GenericSitemap` class allows you to
create a sitemap by passing it a dictionary which has to contain at least
...
...
@@ -267,10 +267,15 @@ The sitemap framework provides a convenience class for a common case:
of the sitemap. It may also have a ``date_field`` entry that
specifies a date field for objects retrieved from the ``queryset``.
This will be used for the :attr:`~Sitemap.lastmod` attribute in the
generated sitemap. You may also pass :attr:`~Sitemap.priority` and
:attr:`~Sitemap.changefreq` keyword arguments to the
:class:`~django.contrib.sitemaps.GenericSitemap` constructor to specify
these attributes for all URLs.
generated sitemap.
The :attr:`~Sitemap.priority`, :attr:`~Sitemap.changefreq`,
and :attr:`~Sitemap.protocol` keyword arguments allow specifying these
attributes for all URLs.
.. versionadded:: 2.0
The ``protocol`` keyword argument was added.
Example
-------
...
...
docs/releases/2.0.txt
Dosyayı görüntüle @
9f21e351
...
...
@@ -89,7 +89,8 @@ Minor features
:mod:`django.contrib.sitemaps`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* ...
* Added the ``protocol`` keyword argument to the
:class:`~django.contrib.sitemaps.GenericSitemap` constructor.
:mod:`django.contrib.sites`
~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
...
tests/sitemaps_tests/test_generic.py
Dosyayı görüntüle @
9f21e351
...
...
@@ -20,11 +20,13 @@ class GenericViewsSitemapTests(SitemapTestsBase):
},
priority
=
0.6
,
changefreq
=
'monthly'
,
protocol
=
'https'
,
)
attr_values
=
(
(
'date_field'
,
datetime_value
),
(
'priority'
,
0.6
),
(
'changefreq'
,
'monthly'
),
(
'protocol'
,
'https'
),
)
for
attr_name
,
expected_value
in
attr_values
:
with
self
.
subTest
(
attr_name
=
attr_name
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment