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
4681d650
Kaydet (Commit)
4681d650
authored
Nis 29, 2016
tarafından
Joshua Phillips
Kaydeden (comit)
Tim Graham
Nis 29, 2016
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #26557 -- Converted empty strings to None when saving GenericIPAddressField.
üst
2f698cd9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
1 deletion
+12
-1
operations.py
django/db/backends/base/operations.py
+1
-1
1.9.6.txt
docs/releases/1.9.6.txt
+3
-0
test_genericipaddressfield.py
tests/model_fields/test_genericipaddressfield.py
+8
-0
No files found.
django/db/backends/base/operations.py
Dosyayı görüntüle @
4681d650
...
@@ -499,7 +499,7 @@ class BaseDatabaseOperations(object):
...
@@ -499,7 +499,7 @@ class BaseDatabaseOperations(object):
Transforms a string representation of an IP address into the expected
Transforms a string representation of an IP address into the expected
type for the backend driver.
type for the backend driver.
"""
"""
return
value
return
value
or
None
def
year_lookup_bounds_for_date_field
(
self
,
value
):
def
year_lookup_bounds_for_date_field
(
self
,
value
):
"""
"""
...
...
docs/releases/1.9.6.txt
Dosyayı görüntüle @
4681d650
...
@@ -24,3 +24,6 @@ Bugfixes
...
@@ -24,3 +24,6 @@ Bugfixes
* Fixed a regression causing the cached template loader to crash when using
* Fixed a regression causing the cached template loader to crash when using
template names starting with a dash (:ticket:`26536`).
template names starting with a dash (:ticket:`26536`).
* Restored conversion of an empty string to null when saving values of
``GenericIPAddressField`` on SQLite and MySQL (:ticket:`26557`).
tests/model_fields/test_genericipaddressfield.py
Dosyayı görüntüle @
4681d650
...
@@ -29,6 +29,14 @@ class GenericIPAddressFieldTests(TestCase):
...
@@ -29,6 +29,14 @@ class GenericIPAddressFieldTests(TestCase):
o
=
GenericIPAddress
.
objects
.
get
()
o
=
GenericIPAddress
.
objects
.
get
()
self
.
assertIsNone
(
o
.
ip
)
self
.
assertIsNone
(
o
.
ip
)
def
test_blank_string_saved_as_null
(
self
):
o
=
GenericIPAddress
.
objects
.
create
(
ip
=
''
)
o
.
refresh_from_db
()
self
.
assertIsNone
(
o
.
ip
)
GenericIPAddress
.
objects
.
update
(
ip
=
''
)
o
.
refresh_from_db
()
self
.
assertIsNone
(
o
.
ip
)
def
test_save_load
(
self
):
def
test_save_load
(
self
):
instance
=
GenericIPAddress
.
objects
.
create
(
ip
=
'::1'
)
instance
=
GenericIPAddress
.
objects
.
create
(
ip
=
'::1'
)
loaded
=
GenericIPAddress
.
objects
.
get
()
loaded
=
GenericIPAddress
.
objects
.
get
()
...
...
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