Loading django/db/backends/base/operations.py +1 −1 Original line number Diff line number Diff line Loading @@ -481,7 +481,7 @@ class BaseDatabaseOperations(object): Transforms a string representation of an IP address into the expected type for the backend driver. """ return value return value or None def year_lookup_bounds_for_date_field(self, value): """ Loading docs/releases/1.8.13.txt +3 −0 Original line number Diff line number Diff line Loading @@ -11,3 +11,6 @@ Bugfixes * Fixed ``TimeField`` microseconds round-tripping on MySQL and SQLite (:ticket:`26498`). * Restored conversion of an empty string to null when saving values of ``GenericIPAddressField`` on SQLite and MySQL (:ticket:`26557`). tests/model_fields/tests.py +8 −0 Original line number Diff line number Diff line Loading @@ -722,6 +722,14 @@ class GenericIPAddressFieldTests(test.TestCase): o = GenericIPAddress.objects.get() 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): instance = GenericIPAddress.objects.create(ip='::1') loaded = GenericIPAddress.objects.get() Loading Loading
django/db/backends/base/operations.py +1 −1 Original line number Diff line number Diff line Loading @@ -481,7 +481,7 @@ class BaseDatabaseOperations(object): Transforms a string representation of an IP address into the expected type for the backend driver. """ return value return value or None def year_lookup_bounds_for_date_field(self, value): """ Loading
docs/releases/1.8.13.txt +3 −0 Original line number Diff line number Diff line Loading @@ -11,3 +11,6 @@ Bugfixes * Fixed ``TimeField`` microseconds round-tripping on MySQL and SQLite (:ticket:`26498`). * Restored conversion of an empty string to null when saving values of ``GenericIPAddressField`` on SQLite and MySQL (:ticket:`26557`).
tests/model_fields/tests.py +8 −0 Original line number Diff line number Diff line Loading @@ -722,6 +722,14 @@ class GenericIPAddressFieldTests(test.TestCase): o = GenericIPAddress.objects.get() 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): instance = GenericIPAddress.objects.create(ip='::1') loaded = GenericIPAddress.objects.get() Loading