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

[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
This commit is contained in:
Russell Keith-Magee 2010-02-11 13:23:11 +00:00
parent f764d7ffb1
commit 0e9f1553e1

View File

@ -81,7 +81,8 @@ class CacheClass(BaseCache):
def has_key(self, key): def has_key(self, key):
now = datetime.now().replace(microsecond=0) now = datetime.now().replace(microsecond=0)
cursor = connection.cursor() 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 return cursor.fetchone() is not None
def _cull(self, cursor, now): def _cull(self, cursor, now):