Loading django/db/backends/base/features.py +0 −3 Original line number Diff line number Diff line Loading @@ -7,9 +7,6 @@ class BaseDatabaseFeatures(object): gis_enabled = False allows_group_by_pk = False allows_group_by_selected_pks = False # True if django.db.backends.utils.typecast_timestamp is used on values # returned from dates() calls. needs_datetime_string_cast = True empty_fetchmany_value = [] update_can_self_select = True Loading django/db/backends/oracle/features.py +0 −1 Original line number Diff line number Diff line Loading @@ -9,7 +9,6 @@ except ImportError: class DatabaseFeatures(BaseDatabaseFeatures): empty_fetchmany_value = () needs_datetime_string_cast = False interprets_empty_strings_as_nulls = True uses_savepoints = True has_select_for_update = True Loading django/db/backends/postgresql_psycopg2/features.py +0 −1 Original line number Diff line number Diff line Loading @@ -4,7 +4,6 @@ from django.db.utils import InterfaceError class DatabaseFeatures(BaseDatabaseFeatures): allows_group_by_selected_pks = True needs_datetime_string_cast = False can_return_id_from_insert = True has_real_datatype = True has_native_uuid_field = True Loading docs/releases/1.9.txt +2 −0 Original line number Diff line number Diff line Loading @@ -326,6 +326,8 @@ Database backend API fetched from the database is to register a converter for ``DateTimeField`` in ``DatabaseOperations.get_db_converters()``. The ``needs_datetime_string_cast`` database feature was removed. Database backends that set it must register a converter instead, as explained above. * The ``DatabaseOperations.value_to_db_<type>()`` methods were renamed to ``adapt_<type>field_value()`` to mirror the ``convert_<type>field_value()`` Loading tests/timezones/tests.py +0 −34 Original line number Diff line number Diff line Loading @@ -106,7 +106,6 @@ class LegacyDatabaseTests(TestCase): self.assertEqual(event.dt.replace(tzinfo=EAT), dt.replace(microsecond=0)) @skipUnlessDBFeature('supports_timezones') @skipIfDBFeature('needs_datetime_string_cast') def test_aware_datetime_in_utc(self): dt = datetime.datetime(2011, 9, 1, 10, 20, 30, tzinfo=UTC) Event.objects.create(dt=dt) Loading @@ -115,24 +114,7 @@ class LegacyDatabaseTests(TestCase): # interpret the naive datetime in local time to get the correct value self.assertEqual(event.dt.replace(tzinfo=EAT), dt) # This combination is no longer possible since timezone support # was removed from the SQLite backend -- it didn't work. @skipUnlessDBFeature('supports_timezones') @skipUnlessDBFeature('needs_datetime_string_cast') def test_aware_datetime_in_utc_unsupported(self): dt = datetime.datetime(2011, 9, 1, 10, 20, 30, tzinfo=UTC) Event.objects.create(dt=dt) event = Event.objects.get() self.assertIsNone(event.dt.tzinfo) # django.db.backends.utils.typecast_dt will just drop the # timezone, so a round-trip in the database alters the data (!) # interpret the naive datetime in local time and you get a wrong value self.assertNotEqual(event.dt.replace(tzinfo=EAT), dt) # interpret the naive datetime in original time to get the correct value self.assertEqual(event.dt.replace(tzinfo=UTC), dt) @skipUnlessDBFeature('supports_timezones') @skipIfDBFeature('needs_datetime_string_cast') def test_aware_datetime_in_other_timezone(self): dt = datetime.datetime(2011, 9, 1, 17, 20, 30, tzinfo=ICT) Event.objects.create(dt=dt) Loading @@ -141,22 +123,6 @@ class LegacyDatabaseTests(TestCase): # interpret the naive datetime in local time to get the correct value self.assertEqual(event.dt.replace(tzinfo=EAT), dt) # This combination is no longer possible since timezone support # was removed from the SQLite backend -- it didn't work. @skipUnlessDBFeature('supports_timezones') @skipUnlessDBFeature('needs_datetime_string_cast') def test_aware_datetime_in_other_timezone_unsupported(self): dt = datetime.datetime(2011, 9, 1, 17, 20, 30, tzinfo=ICT) Event.objects.create(dt=dt) event = Event.objects.get() self.assertIsNone(event.dt.tzinfo) # django.db.backends.utils.typecast_dt will just drop the # timezone, so a round-trip in the database alters the data (!) # interpret the naive datetime in local time and you get a wrong value self.assertNotEqual(event.dt.replace(tzinfo=EAT), dt) # interpret the naive datetime in original time to get the correct value self.assertEqual(event.dt.replace(tzinfo=ICT), dt) @skipIfDBFeature('supports_timezones') def test_aware_datetime_unspported(self): dt = datetime.datetime(2011, 9, 1, 13, 20, 30, tzinfo=EAT) Loading Loading
django/db/backends/base/features.py +0 −3 Original line number Diff line number Diff line Loading @@ -7,9 +7,6 @@ class BaseDatabaseFeatures(object): gis_enabled = False allows_group_by_pk = False allows_group_by_selected_pks = False # True if django.db.backends.utils.typecast_timestamp is used on values # returned from dates() calls. needs_datetime_string_cast = True empty_fetchmany_value = [] update_can_self_select = True Loading
django/db/backends/oracle/features.py +0 −1 Original line number Diff line number Diff line Loading @@ -9,7 +9,6 @@ except ImportError: class DatabaseFeatures(BaseDatabaseFeatures): empty_fetchmany_value = () needs_datetime_string_cast = False interprets_empty_strings_as_nulls = True uses_savepoints = True has_select_for_update = True Loading
django/db/backends/postgresql_psycopg2/features.py +0 −1 Original line number Diff line number Diff line Loading @@ -4,7 +4,6 @@ from django.db.utils import InterfaceError class DatabaseFeatures(BaseDatabaseFeatures): allows_group_by_selected_pks = True needs_datetime_string_cast = False can_return_id_from_insert = True has_real_datatype = True has_native_uuid_field = True Loading
docs/releases/1.9.txt +2 −0 Original line number Diff line number Diff line Loading @@ -326,6 +326,8 @@ Database backend API fetched from the database is to register a converter for ``DateTimeField`` in ``DatabaseOperations.get_db_converters()``. The ``needs_datetime_string_cast`` database feature was removed. Database backends that set it must register a converter instead, as explained above. * The ``DatabaseOperations.value_to_db_<type>()`` methods were renamed to ``adapt_<type>field_value()`` to mirror the ``convert_<type>field_value()`` Loading
tests/timezones/tests.py +0 −34 Original line number Diff line number Diff line Loading @@ -106,7 +106,6 @@ class LegacyDatabaseTests(TestCase): self.assertEqual(event.dt.replace(tzinfo=EAT), dt.replace(microsecond=0)) @skipUnlessDBFeature('supports_timezones') @skipIfDBFeature('needs_datetime_string_cast') def test_aware_datetime_in_utc(self): dt = datetime.datetime(2011, 9, 1, 10, 20, 30, tzinfo=UTC) Event.objects.create(dt=dt) Loading @@ -115,24 +114,7 @@ class LegacyDatabaseTests(TestCase): # interpret the naive datetime in local time to get the correct value self.assertEqual(event.dt.replace(tzinfo=EAT), dt) # This combination is no longer possible since timezone support # was removed from the SQLite backend -- it didn't work. @skipUnlessDBFeature('supports_timezones') @skipUnlessDBFeature('needs_datetime_string_cast') def test_aware_datetime_in_utc_unsupported(self): dt = datetime.datetime(2011, 9, 1, 10, 20, 30, tzinfo=UTC) Event.objects.create(dt=dt) event = Event.objects.get() self.assertIsNone(event.dt.tzinfo) # django.db.backends.utils.typecast_dt will just drop the # timezone, so a round-trip in the database alters the data (!) # interpret the naive datetime in local time and you get a wrong value self.assertNotEqual(event.dt.replace(tzinfo=EAT), dt) # interpret the naive datetime in original time to get the correct value self.assertEqual(event.dt.replace(tzinfo=UTC), dt) @skipUnlessDBFeature('supports_timezones') @skipIfDBFeature('needs_datetime_string_cast') def test_aware_datetime_in_other_timezone(self): dt = datetime.datetime(2011, 9, 1, 17, 20, 30, tzinfo=ICT) Event.objects.create(dt=dt) Loading @@ -141,22 +123,6 @@ class LegacyDatabaseTests(TestCase): # interpret the naive datetime in local time to get the correct value self.assertEqual(event.dt.replace(tzinfo=EAT), dt) # This combination is no longer possible since timezone support # was removed from the SQLite backend -- it didn't work. @skipUnlessDBFeature('supports_timezones') @skipUnlessDBFeature('needs_datetime_string_cast') def test_aware_datetime_in_other_timezone_unsupported(self): dt = datetime.datetime(2011, 9, 1, 17, 20, 30, tzinfo=ICT) Event.objects.create(dt=dt) event = Event.objects.get() self.assertIsNone(event.dt.tzinfo) # django.db.backends.utils.typecast_dt will just drop the # timezone, so a round-trip in the database alters the data (!) # interpret the naive datetime in local time and you get a wrong value self.assertNotEqual(event.dt.replace(tzinfo=EAT), dt) # interpret the naive datetime in original time to get the correct value self.assertEqual(event.dt.replace(tzinfo=ICT), dt) @skipIfDBFeature('supports_timezones') def test_aware_datetime_unspported(self): dt = datetime.datetime(2011, 9, 1, 13, 20, 30, tzinfo=EAT) Loading