1
0
mirror of https://github.com/django/django.git synced 2025-07-04 17:59:13 +00:00

boulder-oracle-sprint: Changed backend property to needs_datetime_string_cast to be

more precise, and make it True for all backends but Oracle to match previous 
behavior.


git-svn-id: http://code.djangoproject.com/svn/django/branches/boulder-oracle-sprint@4084 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Boulder Sprinters 2006-11-17 06:58:45 +00:00
parent 8154294a0f
commit 677aa10cdf
8 changed files with 9 additions and 7 deletions

View File

@ -89,7 +89,7 @@ class DatabaseWrapper(local):
allows_group_by_ordinal = True allows_group_by_ordinal = True
allows_unique_and_pk = True allows_unique_and_pk = True
returns_dates_as_strings = False needs_datetime_string_cast = True
supports_constraints = True supports_constraints = True
uses_case_insensitive_names = False uses_case_insensitive_names = False

View File

@ -132,7 +132,7 @@ class DatabaseWrapper(local):
allows_group_by_ordinal = True allows_group_by_ordinal = True
allows_unique_and_pk = True allows_unique_and_pk = True
returns_dates_as_strings = True # MySQLdb requires a typecast for dates needs_datetime_string_cast = True # MySQLdb requires a typecast for dates
supports_constraints = True supports_constraints = True
uses_case_insensitive_names = False uses_case_insensitive_names = False

View File

@ -61,7 +61,7 @@ class DatabaseWrapper(local):
allows_group_by_ordinal = False allows_group_by_ordinal = False
allows_unique_and_pk = False # Suppress UNIQUE/PK for Oracle (ORA-02259) allows_unique_and_pk = False # Suppress UNIQUE/PK for Oracle (ORA-02259)
returns_dates_as_strings = False needs_datetime_string_cast = False
supports_constraints = True supports_constraints = True
uses_case_insensitive_names = True uses_case_insensitive_names = True

View File

@ -81,6 +81,8 @@ def destroy_test_db(settings, connection, backend, old_database_name, verbosity=
settings.DATABASE_NAME = old_database_name settings.DATABASE_NAME = old_database_name
#settings.DATABASE_USER = 'old_user' #settings.DATABASE_USER = 'old_user'
#settings.DATABASE_PASSWORD = 'old_password' #settings.DATABASE_PASSWORD = 'old_password'
settings.DATABASE_USER = 'mboersma'
settings.DATABASE_PASSWORD = 'password'
cursor = connection.cursor() cursor = connection.cursor()
time.sleep(1) # To avoid "database is being accessed by other users" errors. time.sleep(1) # To avoid "database is being accessed by other users" errors.

View File

@ -63,7 +63,7 @@ class DatabaseWrapper(local):
allows_group_by_ordinal = True allows_group_by_ordinal = True
allows_unique_and_pk = True allows_unique_and_pk = True
returns_dates_as_strings = False needs_datetime_string_cast = True
supports_constraints = True supports_constraints = True
uses_case_insensitive_names = False uses_case_insensitive_names = False

View File

@ -64,7 +64,7 @@ class DatabaseWrapper(local):
allows_group_by_ordinal = True allows_group_by_ordinal = True
allows_unique_and_pk = True allows_unique_and_pk = True
returns_dates_as_strings = False needs_datetime_string_cast = False
supports_constraints = True supports_constraints = True
uses_case_insensitive_names = True uses_case_insensitive_names = True

View File

@ -100,7 +100,7 @@ class SQLiteCursorWrapper(Database.Cursor):
allows_group_by_ordinal = True allows_group_by_ordinal = True
allows_unique_and_pk = True allows_unique_and_pk = True
returns_dates_as_strings = True needs_datetime_string_cast = True
supports_constraints = False supports_constraints = False
uses_case_insensitive_names = False uses_case_insensitive_names = False

View File

@ -567,7 +567,7 @@ class DateQuerySet(QuerySet):
stmt = fmt % (date_trunc_sql, sql, group_by, self._order) stmt = fmt % (date_trunc_sql, sql, group_by, self._order)
cursor = connection.cursor() cursor = connection.cursor()
cursor.execute(stmt, params) cursor.execute(stmt, params)
if backend.returns_dates_as_strings: if backend.needs_datetime_string_cast:
return [typecast_timestamp(str(row[0])) for row in cursor.fetchall()] return [typecast_timestamp(str(row[0])) for row in cursor.fetchall()]
else: else:
return [row[0] for row in cursor.fetchall()] return [row[0] for row in cursor.fetchall()]