

def has_key(self, key, version=None):
    key = self.make_key(key, version=version)
    self.validate_key(version)
    db = router.db_for_read(self.cache_model_class)
    table = connections[db].ops.quote_name(self._table)
    cursor = connections[db].cursor()
    if settings.USE_TZ:
        now = datetime.utcnow()
    else:
        now = datetime.now()
    now = now.replace(microsecond=0)
    cursor.execute(('SELECT cache_key FROM %s WHERE cache_key = %%s and expires > %%s' % table), [key, connections[db].ops.value_to_db_datetime(now)])
    return (cursor.fetchone() is not None)

dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.4/django/core/cache/backends/db.py DatabaseCache.has_key/VarMisuse@33/37 `key`->`version`