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
9ee47ce7
Kaydet (Commit)
9ee47ce7
authored
Ock 19, 2017
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Refs #23919 -- Removed enum ImportError handling for Python 2.
üst
d29fd3f9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
20 deletions
+3
-20
serializer.py
django/db/migrations/serializer.py
+2
-7
writer.py
django/db/migrations/writer.py
+0
-6
test_writer.py
tests/migrations/test_writer.py
+1
-7
No files found.
django/db/migrations/serializer.py
Dosyayı görüntüle @
9ee47ce7
...
...
@@ -2,6 +2,7 @@ import builtins
import
collections
import
datetime
import
decimal
import
enum
import
functools
import
math
import
types
...
...
@@ -17,12 +18,6 @@ from django.utils.functional import LazyObject, Promise
from
django.utils.timezone
import
utc
from
django.utils.version
import
get_docs_version
try
:
import
enum
except
ImportError
:
# No support on Python 2 if enum34 isn't installed.
enum
=
None
class
BaseSerializer
:
def
__init__
(
self
,
value
):
...
...
@@ -349,7 +344,7 @@ def serializer_factory(value):
return
TupleSerializer
(
value
)
if
isinstance
(
value
,
dict
):
return
DictionarySerializer
(
value
)
if
enum
and
isinstance
(
value
,
enum
.
Enum
):
if
isinstance
(
value
,
enum
.
Enum
):
return
EnumSerializer
(
value
)
if
isinstance
(
value
,
datetime
.
datetime
):
return
DatetimeSerializer
(
value
)
...
...
django/db/migrations/writer.py
Dosyayı görüntüle @
9ee47ce7
...
...
@@ -13,12 +13,6 @@ from django.utils.inspect import get_func_args
from
django.utils.module_loading
import
module_dir
from
django.utils.timezone
import
now
try
:
import
enum
except
ImportError
:
# No support on Python 2 if enum34 isn't installed.
enum
=
None
class
SettingsReference
(
str
):
"""
...
...
tests/migrations/test_writer.py
Dosyayı görüntüle @
9ee47ce7
import
datetime
import
decimal
import
enum
import
functools
import
math
import
os
import
re
import
sys
import
tokenize
import
unittest
import
uuid
from
io
import
StringIO
...
...
@@ -31,11 +31,6 @@ from django.utils.translation import ugettext_lazy as _
from
.models
import
FoodManager
,
FoodQuerySet
try
:
import
enum
except
ImportError
:
enum
=
None
PY36
=
sys
.
version_info
>=
(
3
,
6
)
...
...
@@ -259,7 +254,6 @@ class WriterTests(SimpleTestCase):
lazy_pattern
=
SimpleLazyObject
(
lambda
:
pattern
)
self
.
assertEqual
(
self
.
serialize_round_trip
(
lazy_pattern
),
pattern
)
@unittest.skipUnless
(
enum
,
"enum34 is required on Python 2"
)
def
test_serialize_enums
(
self
):
class
TextEnum
(
enum
.
Enum
):
A
=
'a-value'
...
...
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