From eecd42ea7d97bce04bc909c71bed14850060c39c Mon Sep 17 00:00:00 2001 From: Shai Berger Date: Thu, 4 Jun 2015 19:26:43 +0300 Subject: [PATCH] Removed datetime_cast_sql, which is never overridden or used anywhere in Django. Thanks Tim Graham for review. --- django/db/backends/base/operations.py | 9 --------- docs/releases/1.9.txt | 6 ++++++ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/django/db/backends/base/operations.py b/django/db/backends/base/operations.py index f8cee9e755..fe7c27a7e7 100644 --- a/django/db/backends/base/operations.py +++ b/django/db/backends/base/operations.py @@ -90,15 +90,6 @@ class BaseDatabaseOperations(object): """ raise NotImplementedError('subclasses of BaseDatabaseOperations may require a datetrunc_sql() method') - def datetime_cast_sql(self): - """ - Returns the SQL necessary to cast a datetime value so that it will be - retrieved as a Python datetime object instead of a string. - - This SQL should include a '%s' in place of the field's name. - """ - return "%s" - def datetime_cast_date_sql(self, field_name, tzname): """ Returns the SQL necessary to cast a datetime value to date value. diff --git a/docs/releases/1.9.txt b/docs/releases/1.9.txt index 2716932d7b..600c88ca2c 100644 --- a/docs/releases/1.9.txt +++ b/docs/releases/1.9.txt @@ -540,6 +540,12 @@ Database backend API SQLite backend to add time lookups (hour, minute, second) to :class:`~django.db.models.TimeField`, and may be needed by third-party database backends. + +* The ``DatabaseOperations.datetime_cast_sql()`` method (not to be confused + with ``DatabaseOperations.datetime_cast_date_sql()`` mentioned above) + has been removed. This method served to format dates on Oracle long + before 1.0, but hasn't been overridden by any core backend in years + and hasn't been called anywhere in Django's code or tests. Default settings that were tuples are now lists ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~