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
a2ec1e6b
Kaydet (Commit)
a2ec1e6b
authored
Kas 13, 2017
tarafından
Sergey Fedoseev
Kaydeden (comit)
Tim Graham
Kas 13, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Used BaseSimpleSerializer for serializing str and bytes in migrations.
Follow up to
c716fe87
.
üst
b5ecbf1e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
15 deletions
+1
-15
serializer.py
django/db/migrations/serializer.py
+1
-15
No files found.
django/db/migrations/serializer.py
Dosyayı görüntüle @
a2ec1e6b
...
...
@@ -46,11 +46,6 @@ class BaseSimpleSerializer(BaseSerializer):
return
repr
(
self
.
value
),
set
()
class
ByteTypeSerializer
(
BaseSerializer
):
def
serialize
(
self
):
return
repr
(
self
.
value
),
set
()
class
DatetimeSerializer
(
BaseSerializer
):
def
serialize
(
self
):
if
self
.
value
.
tzinfo
is
not
None
and
self
.
value
.
tzinfo
!=
utc
:
...
...
@@ -254,11 +249,6 @@ class SettingsReferenceSerializer(BaseSerializer):
return
"settings.
%
s"
%
self
.
value
.
setting_name
,
{
"from django.conf import settings"
}
class
TextTypeSerializer
(
BaseSerializer
):
def
serialize
(
self
):
return
repr
(
self
.
value
),
set
()
class
TimedeltaSerializer
(
BaseSerializer
):
def
serialize
(
self
):
return
repr
(
self
.
value
),
{
"import datetime"
}
...
...
@@ -346,12 +336,8 @@ def serializer_factory(value):
return
SettingsReferenceSerializer
(
value
)
if
isinstance
(
value
,
float
):
return
FloatSerializer
(
value
)
if
isinstance
(
value
,
(
bool
,
int
,
type
(
None
))):
if
isinstance
(
value
,
(
bool
,
int
,
type
(
None
)
,
bytes
,
str
)):
return
BaseSimpleSerializer
(
value
)
if
isinstance
(
value
,
bytes
):
return
ByteTypeSerializer
(
value
)
if
isinstance
(
value
,
str
):
return
TextTypeSerializer
(
value
)
if
isinstance
(
value
,
decimal
.
Decimal
):
return
DecimalSerializer
(
value
)
if
isinstance
(
value
,
functools
.
partial
):
...
...
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