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
f36151ed
Kaydet (Commit)
f36151ed
authored
Kas 22, 2014
tarafından
Carl Meyer
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #23892 -- Made deconstructible classes forwards compatible
üst
a9cced7a
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
29 additions
and
22 deletions
+29
-22
operations.py
django/contrib/postgres/operations.py
+2
-2
validators.py
django/contrib/postgres/validators.py
+1
-1
storage.py
django/core/files/storage.py
+1
-1
validators.py
django/core/validators.py
+3
-3
base.py
django/db/migrations/operations/base.py
+3
-0
fields.py
django/db/migrations/operations/fields.py
+4
-4
models.py
django/db/migrations/operations/models.py
+8
-8
special.py
django/db/migrations/operations/special.py
+3
-3
1.7.2.txt
docs/releases/1.7.2.txt
+4
-0
No files found.
django/contrib/postgres/operations.py
Dosyayı görüntüle @
f36151ed
...
...
@@ -5,7 +5,7 @@ from django.db.migrations.operations.base import Operation
class
CreateExtension
(
Operation
):
reversible
=
True
def
__init__
(
self
,
name
):
def
__init__
(
self
,
name
,
**
kwargs
):
self
.
name
=
name
def
state_forwards
(
self
,
app_label
,
state
):
...
...
@@ -23,7 +23,7 @@ class CreateExtension(Operation):
class
HStoreExtension
(
CreateExtension
):
def
__init__
(
self
):
def
__init__
(
self
,
**
kwargs
):
self
.
name
=
'hstore'
def
database_forwards
(
self
,
app_label
,
schema_editor
,
from_state
,
to_state
):
...
...
django/contrib/postgres/validators.py
Dosyayı görüntüle @
f36151ed
...
...
@@ -30,7 +30,7 @@ class KeysValidator(object):
}
strict
=
False
def
__init__
(
self
,
keys
,
strict
=
False
,
messages
=
None
):
def
__init__
(
self
,
keys
,
strict
=
False
,
messages
=
None
,
**
kwargs
):
self
.
keys
=
set
(
keys
)
self
.
strict
=
strict
if
messages
is
not
None
:
...
...
django/core/files/storage.py
Dosyayı görüntüle @
f36151ed
...
...
@@ -150,7 +150,7 @@ class FileSystemStorage(Storage):
"""
def
__init__
(
self
,
location
=
None
,
base_url
=
None
,
file_permissions_mode
=
None
,
directory_permissions_mode
=
None
):
directory_permissions_mode
=
None
,
**
kwargs
):
if
location
is
None
:
location
=
settings
.
MEDIA_ROOT
self
.
base_location
=
location
...
...
django/core/validators.py
Dosyayı görüntüle @
f36151ed
...
...
@@ -23,7 +23,7 @@ class RegexValidator(object):
inverse_match
=
False
flags
=
0
def
__init__
(
self
,
regex
=
None
,
message
=
None
,
code
=
None
,
inverse_match
=
None
,
flags
=
None
):
def
__init__
(
self
,
regex
=
None
,
message
=
None
,
code
=
None
,
inverse_match
=
None
,
flags
=
None
,
**
kwargs
):
if
regex
is
not
None
:
self
.
regex
=
regex
if
message
is
not
None
:
...
...
@@ -134,7 +134,7 @@ class EmailValidator(object):
re
.
IGNORECASE
)
domain_whitelist
=
[
'localhost'
]
def
__init__
(
self
,
message
=
None
,
code
=
None
,
whitelist
=
None
):
def
__init__
(
self
,
message
=
None
,
code
=
None
,
whitelist
=
None
,
**
kwargs
):
if
message
is
not
None
:
self
.
message
=
message
if
code
is
not
None
:
...
...
@@ -251,7 +251,7 @@ class BaseValidator(object):
message
=
_
(
'Ensure this value is
%(limit_value)
s (it is
%(show_value)
s).'
)
code
=
'limit_value'
def
__init__
(
self
,
limit_value
,
message
=
None
):
def
__init__
(
self
,
limit_value
,
message
=
None
,
**
kwargs
):
self
.
limit_value
=
limit_value
if
message
:
self
.
message
=
message
...
...
django/db/migrations/operations/base.py
Dosyayı görüntüle @
f36151ed
...
...
@@ -37,6 +37,9 @@ class Operation(object):
self
.
_constructor_args
=
(
args
,
kwargs
)
return
self
def
__init__
(
self
,
**
kwargs
):
pass
def
deconstruct
(
self
):
"""
Returns a 3-tuple of class import path (or just name if it lives
...
...
django/db/migrations/operations/fields.py
Dosyayı görüntüle @
f36151ed
...
...
@@ -10,7 +10,7 @@ class AddField(Operation):
Adds a field to a model.
"""
def
__init__
(
self
,
model_name
,
name
,
field
,
preserve_default
=
True
):
def
__init__
(
self
,
model_name
,
name
,
field
,
preserve_default
=
True
,
**
kwargs
):
self
.
model_name
=
model_name
self
.
name
=
name
self
.
field
=
field
...
...
@@ -69,7 +69,7 @@ class RemoveField(Operation):
Removes a field from a model.
"""
def
__init__
(
self
,
model_name
,
name
):
def
__init__
(
self
,
model_name
,
name
,
**
kwargs
):
self
.
model_name
=
model_name
self
.
name
=
name
...
...
@@ -113,7 +113,7 @@ class AlterField(Operation):
Alters a field's database column (e.g. null, max_length) to the provided new field
"""
def
__init__
(
self
,
model_name
,
name
,
field
,
preserve_default
=
True
):
def
__init__
(
self
,
model_name
,
name
,
field
,
preserve_default
=
True
,
**
kwargs
):
self
.
model_name
=
model_name
self
.
name
=
name
self
.
field
=
field
...
...
@@ -177,7 +177,7 @@ class RenameField(Operation):
Renames a field on the model. Might affect db_column too.
"""
def
__init__
(
self
,
model_name
,
old_name
,
new_name
):
def
__init__
(
self
,
model_name
,
old_name
,
new_name
,
**
kwargs
):
self
.
model_name
=
model_name
self
.
old_name
=
old_name
self
.
new_name
=
new_name
...
...
django/db/migrations/operations/models.py
Dosyayı görüntüle @
f36151ed
...
...
@@ -14,7 +14,7 @@ class CreateModel(Operation):
serialization_expand_args
=
[
'fields'
,
'options'
]
def
__init__
(
self
,
name
,
fields
,
options
=
None
,
bases
=
None
):
def
__init__
(
self
,
name
,
fields
,
options
=
None
,
bases
=
None
,
**
kwargs
):
self
.
name
=
name
self
.
fields
=
fields
self
.
options
=
options
or
{}
...
...
@@ -79,7 +79,7 @@ class DeleteModel(Operation):
Drops a model's table.
"""
def
__init__
(
self
,
name
):
def
__init__
(
self
,
name
,
**
kwargs
):
self
.
name
=
name
def
deconstruct
(
self
):
...
...
@@ -116,7 +116,7 @@ class RenameModel(Operation):
Renames a model.
"""
def
__init__
(
self
,
old_name
,
new_name
):
def
__init__
(
self
,
old_name
,
new_name
,
**
kwargs
):
self
.
old_name
=
old_name
self
.
new_name
=
new_name
...
...
@@ -209,7 +209,7 @@ class AlterModelTable(Operation):
Renames a model's table
"""
def
__init__
(
self
,
name
,
table
):
def
__init__
(
self
,
name
,
table
,
**
kwargs
):
self
.
name
=
name
self
.
table
=
table
...
...
@@ -260,7 +260,7 @@ class AlterUniqueTogether(Operation):
"""
option_name
=
"unique_together"
def
__init__
(
self
,
name
,
unique_together
):
def
__init__
(
self
,
name
,
unique_together
,
**
kwargs
):
self
.
name
=
name
unique_together
=
normalize_together
(
unique_together
)
self
.
unique_together
=
set
(
tuple
(
cons
)
for
cons
in
unique_together
)
...
...
@@ -305,7 +305,7 @@ class AlterIndexTogether(Operation):
"""
option_name
=
"index_together"
def
__init__
(
self
,
name
,
index_together
):
def
__init__
(
self
,
name
,
index_together
,
**
kwargs
):
self
.
name
=
name
index_together
=
normalize_together
(
index_together
)
self
.
index_together
=
set
(
tuple
(
cons
)
for
cons
in
index_together
)
...
...
@@ -348,7 +348,7 @@ class AlterOrderWithRespectTo(Operation):
Represents a change with the order_with_respect_to option.
"""
def
__init__
(
self
,
name
,
order_with_respect_to
):
def
__init__
(
self
,
name
,
order_with_respect_to
,
**
kwargs
):
self
.
name
=
name
self
.
order_with_respect_to
=
order_with_respect_to
...
...
@@ -407,7 +407,7 @@ class AlterModelOptions(Operation):
"verbose_name_plural"
,
]
def
__init__
(
self
,
name
,
options
):
def
__init__
(
self
,
name
,
options
,
**
kwargs
):
self
.
name
=
name
self
.
options
=
options
...
...
django/db/migrations/operations/special.py
Dosyayı görüntüle @
f36151ed
...
...
@@ -11,7 +11,7 @@ class SeparateDatabaseAndState(Operation):
that affect the state or not the database, or so on.
"""
def
__init__
(
self
,
database_operations
=
None
,
state_operations
=
None
):
def
__init__
(
self
,
database_operations
=
None
,
state_operations
=
None
,
**
kwargs
):
self
.
database_operations
=
database_operations
or
[]
self
.
state_operations
=
state_operations
or
[]
...
...
@@ -62,7 +62,7 @@ class RunSQL(Operation):
by this SQL change, in case it's custom column/table creation/deletion.
"""
def
__init__
(
self
,
sql
,
reverse_sql
=
None
,
state_operations
=
None
):
def
__init__
(
self
,
sql
,
reverse_sql
=
None
,
state_operations
=
None
,
**
kwargs
):
self
.
sql
=
sql
self
.
reverse_sql
=
reverse_sql
self
.
state_operations
=
state_operations
or
[]
...
...
@@ -122,7 +122,7 @@ class RunPython(Operation):
reduces_to_sql
=
False
def
__init__
(
self
,
code
,
reverse_code
=
None
,
atomic
=
True
):
def
__init__
(
self
,
code
,
reverse_code
=
None
,
atomic
=
True
,
**
kwargs
):
self
.
atomic
=
atomic
# Forwards code
if
not
callable
(
code
):
...
...
docs/releases/1.7.2.txt
Dosyayı görüntüle @
f36151ed
...
...
@@ -77,3 +77,7 @@ Bugfixes
* Fixed a crash in migrations when deleting a field that is part of a
``index/unique_together`` constraint (:ticket:`23794`).
* Made the initializers of deconstructible classes, such as migration
operations and validators, accept kwargs for forwards compatibility
(:ticket:`23892`).
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