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
65732741
Kaydet (Commit)
65732741
authored
Kas 12, 2016
tarafından
Brandon Chinn
Kaydeden (comit)
Tim Graham
Kas 15, 2016
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Refs #27003 -- Fixed SimpleArrayField crash on converted values.
üst
74ed20b4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
1 deletion
+9
-1
AUTHORS
AUTHORS
+1
-0
array.py
django/contrib/postgres/forms/array.py
+3
-1
test_array.py
tests/postgres_tests/test_array.py
+5
-0
No files found.
AUTHORS
Dosyayı görüntüle @
65732741
...
@@ -110,6 +110,7 @@ answer newbie questions, and generally made Django that much better:
...
@@ -110,6 +110,7 @@ answer newbie questions, and generally made Django that much better:
Bouke Haarsma <bouke@haarsma.eu>
Bouke Haarsma <bouke@haarsma.eu>
Božidar Benko <bbenko@gmail.com>
Božidar Benko <bbenko@gmail.com>
Brad Melin <melinbrad@gmail.com>
Brad Melin <melinbrad@gmail.com>
Brandon Chinn <http://brandonchinn178.github.io>
Brant Harris
Brant Harris
Brendan Hayward <brendanhayward85@gmail.com>
Brendan Hayward <brendanhayward85@gmail.com>
Brenton Simpson <http://theillustratedlife.com>
Brenton Simpson <http://theillustratedlife.com>
...
...
django/contrib/postgres/forms/array.py
Dosyayı görüntüle @
65732741
...
@@ -35,7 +35,9 @@ class SimpleArrayField(forms.CharField):
...
@@ -35,7 +35,9 @@ class SimpleArrayField(forms.CharField):
return
value
return
value
def
to_python
(
self
,
value
):
def
to_python
(
self
,
value
):
if
value
:
if
isinstance
(
value
,
list
):
items
=
value
elif
value
:
items
=
value
.
split
(
self
.
delimiter
)
items
=
value
.
split
(
self
.
delimiter
)
else
:
else
:
items
=
[]
items
=
[]
...
...
tests/postgres_tests/test_array.py
Dosyayı görüntüle @
65732741
...
@@ -677,6 +677,11 @@ class TestSimpleFormField(PostgreSQLTestCase):
...
@@ -677,6 +677,11 @@ class TestSimpleFormField(PostgreSQLTestCase):
self
.
assertIsInstance
(
form_field
,
SimpleArrayField
)
self
.
assertIsInstance
(
form_field
,
SimpleArrayField
)
self
.
assertEqual
(
form_field
.
max_length
,
4
)
self
.
assertEqual
(
form_field
.
max_length
,
4
)
def
test_already_converted_value
(
self
):
field
=
SimpleArrayField
(
forms
.
CharField
())
vals
=
[
'a'
,
'b'
,
'c'
]
self
.
assertEqual
(
field
.
clean
(
vals
),
vals
)
class
TestSplitFormField
(
PostgreSQLTestCase
):
class
TestSplitFormField
(
PostgreSQLTestCase
):
...
...
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