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
115c3071
Kaydet (Commit)
115c3071
authored
Eki 10, 2014
tarafından
Jaap Roes
Kaydeden (comit)
Tim Graham
Eki 10, 2014
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #23613 -- Deprecated django.utils.checksums
üst
1b5918f1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
1 deletion
+30
-1
checksums.py
django/utils/checksums.py
+9
-0
deprecation.txt
docs/internals/deprecation.txt
+3
-0
1.8.txt
docs/releases/1.8.txt
+10
-0
test_checksums.py
tests/utils_tests/test_checksums.py
+8
-1
No files found.
django/utils/checksums.py
Dosyayı görüntüle @
115c3071
...
@@ -4,7 +4,16 @@ Common checksum routines.
...
@@ -4,7 +4,16 @@ Common checksum routines.
__all__
=
[
'luhn'
]
__all__
=
[
'luhn'
]
import
warnings
from
django.utils
import
six
from
django.utils
import
six
from
django.utils.deprecation
import
RemovedInDjango20Warning
warnings
.
warn
(
"django.utils.checksums will be removed in Django 2.0. The "
"luhn() function is now included in django-localflavor 1.1+."
,
RemovedInDjango20Warning
)
LUHN_ODD_LOOKUP
=
(
0
,
2
,
4
,
6
,
8
,
1
,
3
,
5
,
7
,
9
)
# sum_of_digits(index * 2)
LUHN_ODD_LOOKUP
=
(
0
,
2
,
4
,
6
,
8
,
1
,
3
,
5
,
7
,
9
)
# sum_of_digits(index * 2)
...
...
docs/internals/deprecation.txt
Dosyayı görüntüle @
115c3071
...
@@ -59,6 +59,9 @@ about each item can often be found in the release notes of two versions prior.
...
@@ -59,6 +59,9 @@ about each item can often be found in the release notes of two versions prior.
* ``django.db.models.field.subclassing.SubfieldBase`` will be removed.
* ``django.db.models.field.subclassing.SubfieldBase`` will be removed.
* ``django.utils.checksums`` will be removed; its functionality is included
in django-localflavor 1.1+.
.. _deprecation-removed-in-1.9:
.. _deprecation-removed-in-1.9:
1.9
1.9
...
...
docs/releases/1.8.txt
Dosyayı görüntüle @
115c3071
...
@@ -829,3 +829,13 @@ in ``.values()`` calls or in aggregates. It has been replaced with
...
@@ -829,3 +829,13 @@ in ``.values()`` calls or in aggregates. It has been replaced with
:meth:`~django.db.models.Field.from_db_value`. Note that the new approach does
:meth:`~django.db.models.Field.from_db_value`. Note that the new approach does
not call the :meth:`~django.db.models.Field.to_python` method on assignment
not call the :meth:`~django.db.models.Field.to_python` method on assignment
as was the case with ``SubfieldBase``.
as was the case with ``SubfieldBase``.
``django.utils.checksums``
~~~~~~~~~~~~~~~~~~~~~~~~~~
The ``django.utils.checksums`` module has been deprecated and will be removed
in Django 2.0. The functionality it provided (validating checksum using the
Luhn algorithm) was undocumented and not used in Django. The module has been
moved to the `django-localflavor`_ package (version 1.1+).
.. _django-localflavor: https://pypi.python.org/pypi/django-localflavor
tests/utils_tests/test_checksums.py
Dosyayı görüntüle @
115c3071
import
unittest
import
unittest
import
warnings
from
django.utils
import
checksums
from
django.utils.deprecation
import
RemovedInDjango20Warning
with
warnings
.
catch_warnings
():
warnings
.
filterwarnings
(
'ignore'
,
'django.utils.checksums will be removed in Django 2.0.'
,
RemovedInDjango20Warning
)
from
django.utils
import
checksums
class
TestUtilsChecksums
(
unittest
.
TestCase
):
class
TestUtilsChecksums
(
unittest
.
TestCase
):
...
...
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