mirror of
https://github.com/Hopiu/django-cachalot.git
synced 2026-05-10 13:44:44 +00:00
Mark datetime types as valid SQL param types (for psycopg2).
This commit is contained in:
parent
104f58e97d
commit
e72c6c5e85
1 changed files with 5 additions and 1 deletions
|
|
@ -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):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Reference in a new issue