Mark datetime types as valid SQL param types (for psycopg2).

This commit is contained in:
Bertrand Bordage 2015-10-02 20:45:43 +02:00
parent 104f58e97d
commit e72c6c5e85

View file

@ -1,6 +1,7 @@
# coding: utf-8
from __future__ import unicode_literals
import datetime
from hashlib import sha1
from time import time
@ -18,7 +19,10 @@ class UncachableQuery(Exception):
pass
CACHABLE_PARAM_TYPES = (bool, int, binary_type, text_type, type(None))
CACHABLE_PARAM_TYPES = (
bool, int, binary_type, text_type, type(None),
datetime.date, datetime.time, datetime.datetime, datetime.timedelta
)
def get_query_cache_key(compiler):
"""