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
adfdb9f1
Kaydet (Commit)
adfdb9f1
authored
Eki 11, 2018
tarafından
Patrik Sletmo
Kaydeden (comit)
Tim Graham
Eki 11, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #29814 -- Added support for NoneType serialization in migrations.
üst
52fec5d1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
1 deletion
+12
-1
AUTHORS
AUTHORS
+1
-0
serializer.py
django/db/migrations/serializer.py
+1
-0
2.2.txt
docs/releases/2.2.txt
+2
-0
migrations.txt
docs/topics/migrations.txt
+5
-1
test_writer.py
tests/migrations/test_writer.py
+3
-0
No files found.
AUTHORS
Dosyayı görüntüle @
adfdb9f1
...
...
@@ -651,6 +651,7 @@ answer newbie questions, and generally made Django that much better:
Panos Laganakos <panos.laganakos@gmail.com>
Pascal Hartig <phartig@rdrei.net>
Pascal Varet
Patrik Sletmo <patrik.sletmo@gmail.com>
Paul Bissex <http://e-scribe.com/>
Paul Collier <paul@paul-collier.com>
Paul Collins <paul.collins.iii@gmail.com>
...
...
django/db/migrations/serializer.py
Dosyayı görüntüle @
adfdb9f1
...
...
@@ -252,6 +252,7 @@ class TypeSerializer(BaseSerializer):
def
serialize
(
self
):
special_cases
=
[
(
models
.
Model
,
"models.Model"
,
[]),
(
type
(
None
),
'type(None)'
,
[]),
]
for
case
,
string
,
imports
in
special_cases
:
if
case
is
self
.
value
:
...
...
docs/releases/2.2.txt
Dosyayı görüntüle @
adfdb9f1
...
...
@@ -188,6 +188,8 @@ Migrations
* The new :option:`migrate --plan` option prints the list of migration
operations that will be performed.
* ``NoneType`` can now be serialized in migrations.
Models
~~~~~~
...
...
docs/topics/migrations.txt
Dosyayı görüntüle @
adfdb9f1
...
...
@@ -666,7 +666,7 @@ for basic values, and doesn't specify import paths).
Django can serialize the following:
- ``int``, ``float``, ``bool``, ``str``, ``bytes``, ``None``
- ``int``, ``float``, ``bool``, ``str``, ``bytes``, ``None``
, ``NoneType``
- ``list``, ``set``, ``tuple``, ``dict``
- ``datetime.date``, ``datetime.time``, and ``datetime.datetime`` instances
(include those that are timezone-aware)
...
...
@@ -686,6 +686,10 @@ Django can serialize the following:
Serialization support for :class:`functools.partialmethod` was added.
.. versionchanged:: 2.2
Serialization support for ``NoneType`` was added.
Django cannot serialize:
- Nested classes
...
...
tests/migrations/test_writer.py
Dosyayı görüntüle @
adfdb9f1
...
...
@@ -513,6 +513,9 @@ class WriterTests(SimpleTestCase):
self
.
assertEqual
(
result
.
args
,
value
.
args
)
self
.
assertEqual
(
result
.
keywords
,
value
.
keywords
)
def
test_serialize_type_none
(
self
):
self
.
assertSerializedEqual
(
type
(
None
))
def
test_simple_migration
(
self
):
"""
Tests serializing a simple migration.
...
...
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