mirror of
https://github.com/Hopiu/django-cachalot.git
synced 2026-05-21 19:01:52 +00:00
Fixes hashing on Python 3.
This commit is contained in:
parent
5e638805d7
commit
f3eaf75ed1
1 changed files with 6 additions and 2 deletions
|
|
@ -31,8 +31,12 @@ PATCHED = False
|
|||
MISS_VALUE = '[[Missing cache key]]'
|
||||
|
||||
|
||||
def hash_cache_key(unicode_key):
|
||||
return md5(unicode_key.encode('utf-8')).hexdigest()
|
||||
|
||||
|
||||
def _get_query_cache_key(compiler):
|
||||
return md5('%s:%s' % compiler.as_sql()).hexdigest()
|
||||
return hash_cache_key('%s:%s' % compiler.as_sql())
|
||||
|
||||
|
||||
def _get_tables(query):
|
||||
|
|
@ -45,7 +49,7 @@ def _get_tables(query):
|
|||
|
||||
|
||||
def _get_table_cache_key(table):
|
||||
return md5('%s_queries' % table).hexdigest()
|
||||
return hash_cache_key('%s_queries' % table)
|
||||
|
||||
|
||||
def _get_tables_cache_keys(query):
|
||||
|
|
|
|||
Loading…
Reference in a new issue