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
125b3d44
Kaydet (Commit)
125b3d44
authored
May 20, 2014
tarafından
Andrew Godwin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #22649: Beefed up quote_value
üst
4e32e473
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
10 deletions
+8
-10
schema.py
django/db/backends/mysql/schema.py
+3
-8
schema.py
django/db/backends/oracle/schema.py
+4
-1
schema.py
django/db/backends/sqlite3/schema.py
+1
-1
No files found.
django/db/backends/mysql/schema.py
Dosyayı görüntüle @
125b3d44
...
@@ -30,11 +30,7 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
...
@@ -30,11 +30,7 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
def
quote_value
(
self
,
value
):
def
quote_value
(
self
,
value
):
# Inner import to allow module to fail to load gracefully
# Inner import to allow module to fail to load gracefully
import
MySQLdb.converters
import
MySQLdb.converters
return
MySQLdb
.
escape
(
value
,
MySQLdb
.
converters
.
conversions
)
if
isinstance
(
value
,
six
.
string_types
):
return
'"
%
s"'
%
six
.
text_type
(
value
)
else
:
return
MySQLdb
.
escape
(
value
,
MySQLdb
.
converters
.
conversions
)
def
skip_default
(
self
,
field
):
def
skip_default
(
self
,
field
):
"""
"""
...
@@ -49,8 +45,7 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
...
@@ -49,8 +45,7 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
# Simulate the effect of a one-off default.
# Simulate the effect of a one-off default.
if
self
.
skip_default
(
field
)
and
field
.
default
not
in
{
None
,
NOT_PROVIDED
}:
if
self
.
skip_default
(
field
)
and
field
.
default
not
in
{
None
,
NOT_PROVIDED
}:
effective_default
=
self
.
effective_default
(
field
)
effective_default
=
self
.
effective_default
(
field
)
self
.
execute
(
'UPDATE
%(table)
s SET
%(column)
s
=
%(default)
s'
%
{
self
.
execute
(
'UPDATE
%(table)
s SET
%(column)
s
=
%%
s'
%
{
'table'
:
self
.
quote_name
(
model
.
_meta
.
db_table
),
'table'
:
self
.
quote_name
(
model
.
_meta
.
db_table
),
'column'
:
self
.
quote_name
(
field
.
column
),
'column'
:
self
.
quote_name
(
field
.
column
),
'default'
:
self
.
quote_value
(
effective_default
),
},
[
effective_default
])
})
django/db/backends/oracle/schema.py
Dosyayı görüntüle @
125b3d44
import
copy
import
copy
import
datetime
import
datetime
import
binascii
from
django.utils
import
six
from
django.utils
import
six
from
django.db.backends.schema
import
BaseDatabaseSchemaEditor
from
django.db.backends.schema
import
BaseDatabaseSchemaEditor
...
@@ -21,7 +22,9 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
...
@@ -21,7 +22,9 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
if
isinstance
(
value
,
(
datetime
.
date
,
datetime
.
time
,
datetime
.
datetime
)):
if
isinstance
(
value
,
(
datetime
.
date
,
datetime
.
time
,
datetime
.
datetime
)):
return
"'
%
s'"
%
value
return
"'
%
s'"
%
value
elif
isinstance
(
value
,
six
.
string_types
):
elif
isinstance
(
value
,
six
.
string_types
):
return
repr
(
value
)
return
"'
%
s'"
%
six
.
text_type
(
value
)
.
replace
(
"
\'
"
,
"
\'\'
"
)
elif
isinstance
(
value
,
buffer
):
return
"'
%
s'"
%
binascii
.
hexlify
(
value
)
elif
isinstance
(
value
,
bool
):
elif
isinstance
(
value
,
bool
):
return
"1"
if
value
else
"0"
return
"1"
if
value
else
"0"
else
:
else
:
...
...
django/db/backends/sqlite3/schema.py
Dosyayı görüntüle @
125b3d44
...
@@ -27,7 +27,7 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
...
@@ -27,7 +27,7 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
elif
isinstance
(
value
,
six
.
integer_types
):
elif
isinstance
(
value
,
six
.
integer_types
):
return
str
(
value
)
return
str
(
value
)
elif
isinstance
(
value
,
six
.
string_types
):
elif
isinstance
(
value
,
six
.
string_types
):
return
'"
%
s"'
%
six
.
text_type
(
value
)
return
"'
%
s'"
%
six
.
text_type
(
value
)
.
replace
(
"
\'
"
,
"
\'\'
"
)
elif
value
is
None
:
elif
value
is
None
:
return
"NULL"
return
"NULL"
elif
isinstance
(
value
,
(
bytes
,
bytearray
,
six
.
memoryview
)):
elif
isinstance
(
value
,
(
bytes
,
bytearray
,
six
.
memoryview
)):
...
...
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