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
4e68e861
Kaydet (Commit)
4e68e861
authored
Agu 12, 2012
tarafından
Aymeric Augustin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
[py3] Deprecated StrAndUnicode.
This mix-in is superseded by the @python_2_unicode_compatible decorator.
üst
d4a0b278
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
+14
-0
encoding.py
django/utils/encoding.py
+7
-0
1.5.txt
docs/releases/1.5.txt
+7
-0
No files found.
django/utils/encoding.py
Dosyayı görüntüle @
4e68e861
...
@@ -8,6 +8,7 @@ try:
...
@@ -8,6 +8,7 @@ try:
from
urllib.parse
import
quote
from
urllib.parse
import
quote
except
ImportError
:
# Python 2
except
ImportError
:
# Python 2
from
urllib
import
quote
from
urllib
import
quote
import
warnings
from
django.utils.functional
import
Promise
from
django.utils.functional
import
Promise
from
django.utils
import
six
from
django.utils
import
six
...
@@ -32,6 +33,12 @@ class StrAndUnicode(object):
...
@@ -32,6 +33,12 @@ class StrAndUnicode(object):
Useful as a mix-in. If you support Python 2 and 3 with a single code base,
Useful as a mix-in. If you support Python 2 and 3 with a single code base,
you can inherit this mix-in and just define __unicode__.
you can inherit this mix-in and just define __unicode__.
"""
"""
def
__init__
(
self
,
*
args
,
**
kwargs
):
warnings
.
warn
(
"StrAndUnicode is deprecated. Define a __str__ method "
"and apply the @python_2_unicode_compatible decorator "
"instead."
,
PendingDeprecationWarning
,
stacklevel
=
2
)
super
(
StrAndUnicode
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
if
six
.
PY3
:
if
six
.
PY3
:
def
__str__
(
self
):
def
__str__
(
self
):
return
self
.
__unicode__
()
return
self
.
__unicode__
()
...
...
docs/releases/1.5.txt
Dosyayı görüntüle @
4e68e861
...
@@ -273,3 +273,10 @@ our own copy of ``simplejson``. You can safely change any use of
...
@@ -273,3 +273,10 @@ our own copy of ``simplejson``. You can safely change any use of
The :func:`~django.utils.itercompat.product` function has been deprecated. Use
The :func:`~django.utils.itercompat.product` function has been deprecated. Use
the built-in :func:`itertools.product` instead.
the built-in :func:`itertools.product` instead.
``django.utils.encoding.StrAndUnicode``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The :class:`~django.utils.encoding.StrAndUnicode` mix-in has been deprecated.
Define a ``__str__`` method and apply the
:func:`~django.utils.encoding.python_2_unicode_compatible` decorator instead.
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