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
4fe6824f
Kaydet (Commit)
4fe6824f
authored
Eki 20, 2014
tarafından
Claude Paroz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #23679 -- Fixed null introspection for char/text fields
Thanks Paul Dejean for the report.
üst
2118aa8a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
2 deletions
+3
-2
inspectdb.py
django/core/management/commands/inspectdb.py
+1
-2
models.py
tests/inspectdb/models.py
+1
-0
tests.py
tests/inspectdb/tests.py
+1
-0
No files found.
django/core/management/commands/inspectdb.py
Dosyayı görüntüle @
4fe6824f
...
...
@@ -123,8 +123,7 @@ class Command(BaseCommand):
field_type
=
'NullBooleanField('
else
:
extra_params
[
'blank'
]
=
True
if
field_type
not
in
(
'TextField('
,
'CharField('
):
extra_params
[
'null'
]
=
True
extra_params
[
'null'
]
=
True
field_desc
=
'
%
s =
%
s
%
s'
%
(
att_name
,
...
...
tests/inspectdb/models.py
Dosyayı görüntüle @
4fe6824f
...
...
@@ -50,6 +50,7 @@ class ColumnTypes(models.Model):
bool_field
=
models
.
BooleanField
(
default
=
False
)
null_bool_field
=
models
.
NullBooleanField
()
char_field
=
models
.
CharField
(
max_length
=
10
)
null_char_field
=
models
.
CharField
(
max_length
=
10
,
blank
=
True
,
null
=
True
)
comma_separated_int_field
=
models
.
CommaSeparatedIntegerField
(
max_length
=
99
)
date_field
=
models
.
DateField
()
date_time_field
=
models
.
DateTimeField
()
...
...
tests/inspectdb/tests.py
Dosyayı görüntüle @
4fe6824f
...
...
@@ -51,6 +51,7 @@ class InspectDBTestCase(TestCase):
if
(
connection
.
features
.
can_introspect_max_length
and
not
connection
.
features
.
interprets_empty_strings_as_nulls
):
assertFieldType
(
'char_field'
,
"models.CharField(max_length=10)"
)
assertFieldType
(
'null_char_field'
,
"models.CharField(max_length=10, blank=True, null=True)"
)
assertFieldType
(
'comma_separated_int_field'
,
"models.CharField(max_length=99)"
)
assertFieldType
(
'date_field'
,
"models.DateField()"
)
assertFieldType
(
'date_time_field'
,
"models.DateTimeField()"
)
...
...
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