From 0e9f1553e1e5766559b077483ae445af11d9bb82 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Thu, 11 Feb 2010 13:23:11 +0000 Subject: [PATCH] [1.1.X] Corrected merge of r12411 to 1.1.X branch (see r12415). git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@12416 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/core/cache/backends/db.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/django/core/cache/backends/db.py b/django/core/cache/backends/db.py index 0cdccbad16..07cf22a317 100644 --- a/django/core/cache/backends/db.py +++ b/django/core/cache/backends/db.py @@ -81,7 +81,8 @@ class CacheClass(BaseCache): def has_key(self, key): now = datetime.now().replace(microsecond=0) cursor = connection.cursor() - cursor.execute("SELECT cache_key FROM %s WHERE cache_key = %%s and expires > %%s" % self._table, [key, now]) + cursor.execute("SELECT cache_key FROM %s WHERE cache_key = %%s and expires > %%s" % self._table, + [key, connection.ops.value_to_db_datetime(now)]) return cursor.fetchone() is not None def _cull(self, cursor, now):