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
4680d25d
Kaydet (Commit)
4680d25d
authored
Eyl 06, 2014
tarafından
Andrew Pinkham
Kaydeden (comit)
Tim Graham
Eyl 08, 2014
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #22951 -- Checked for types during deep_deconstruct migration serialization process.
Thanks Sam Hartsfield for the report.
üst
f36ab2d3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
1 deletion
+28
-1
autodetector.py
django/db/migrations/autodetector.py
+1
-1
1.7.1.txt
docs/releases/1.7.1.txt
+2
-0
test_autodetector.py
tests/migrations/test_autodetector.py
+25
-0
No files found.
django/db/migrations/autodetector.py
Dosyayı görüntüle @
4680d25d
...
...
@@ -49,7 +49,7 @@ class MigrationAutodetector(object):
Used for full comparison for rename/alter; sometimes a single-level
deconstruction will not compare correctly.
"""
if
not
hasattr
(
obj
,
'deconstruct'
):
if
not
hasattr
(
obj
,
'deconstruct'
)
or
isinstance
(
obj
,
type
)
:
return
obj
deconstructed
=
obj
.
deconstruct
()
if
isinstance
(
obj
,
models
.
Field
):
...
...
docs/releases/1.7.1.txt
Dosyayı görüntüle @
4680d25d
...
...
@@ -16,3 +16,5 @@ Bugfixes
* Reinstated missing ``CHECK`` SQL clauses which were omitted on some backends
when not using migrations (:ticket:`23416`).
* Fixed serialization of ``type`` objects in migrations (:ticket:`22951`).
tests/migrations/test_autodetector.py
Dosyayı görüntüle @
4680d25d
...
...
@@ -702,6 +702,31 @@ class AutodetectorTests(TestCase):
changes
=
autodetector
.
_detect_changes
()
self
.
assertEqual
(
changes
,
{})
def
test_deconstruct_type
(
self
):
"""
#22951 -- Uninstanted classes with deconstruct are correctly returned
by deep_deconstruct during serialization.
"""
author
=
ModelState
(
"testapp"
,
"Author"
,
[
(
"id"
,
models
.
AutoField
(
primary_key
=
True
)),
(
"name"
,
models
.
CharField
(
max_length
=
200
,
# IntegerField intentionally not instantiated.
default
=
models
.
IntegerField
,
))
],
)
# Make state
before
=
self
.
make_project_state
([])
after
=
self
.
make_project_state
([
author
])
autodetector
=
MigrationAutodetector
(
before
,
after
)
changes
=
autodetector
.
_detect_changes
()
self
.
assertNumberMigrations
(
changes
,
'testapp'
,
1
)
self
.
assertOperationTypes
(
changes
,
'testapp'
,
0
,
[
"CreateModel"
])
def
test_replace_string_with_foreignkey
(
self
):
"""
Adding an FK in the same "spot" as a deleted CharField should work. (#22300).
...
...
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