From c471cfd67425a6394a6f91bf6e71573e8f482850 Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Wed, 29 Feb 2012 08:57:48 +0000 Subject: [PATCH] Avoided importing _mysql directly. Refs #17755. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17602 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/db/backends/mysql/base.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/django/db/backends/mysql/base.py b/django/db/backends/mysql/base.py index cefd86f330..5ad7b893e8 100644 --- a/django/db/backends/mysql/base.py +++ b/django/db/backends/mysql/base.py @@ -23,9 +23,8 @@ if (version < (1,2,1) or (version[:3] == (1, 2, 1) and from django.core.exceptions import ImproperlyConfigured raise ImproperlyConfigured("MySQLdb-1.2.1p2 or newer is required; you have %s" % Database.__version__) -from MySQLdb.converters import conversions +from MySQLdb.converters import conversions, Thing2Literal from MySQLdb.constants import FIELD_TYPE, CLIENT -from _mysql import string_literal from django.db import utils from django.db.backends import * @@ -66,7 +65,7 @@ def adapt_datetime_with_timezone_support(value, conv): default_timezone = timezone.get_default_timezone() value = timezone.make_aware(value, default_timezone) value = value.astimezone(timezone.utc).replace(tzinfo=None) - return string_literal(value.strftime("%Y-%m-%d %H:%M:%S"), conv) + return Thing2Literal(value.strftime("%Y-%m-%d %H:%M:%S"), conv) # MySQLdb-1.2.1 returns TIME columns as timedelta -- they are more like # timedelta in terms of actual behavior as they are signed and include days --