Closed ukjin1192 closed 10 years ago
Hi!
I have tested the proposed problem, but everything seems works correctly:
>>> cache.set("aaa", "aaa", None)
True
>>> from redis_cache import get_redis_connection
>>> get_redis_connection("default")
Redis<ConnectionPool<Connection<host=127.0.0.1,port=6379,db=1>>>
>>> get_redis_connection("default").get("aaa") # expected: because cache prefixes all keys
>>> get_redis_connection("default").get(":1:aaa") # expected: retrieve key with prefix.
b'\x80\x04\x95\x07\x00\x00\x00\x00\x00\x00\x00\x8c\x03aaa\x94.'
>>> get_redis_connection("default").set(":1:bbb", "1", None)
True
>>> cache.get("bbb")
1
It is possible that I do not understand your question, sorry! Can you explain me more that is the problem?
Problem solved !
I thought that there is an API which can handle the cache's location as following.
get_redis_connection("default").selectDB("1").set("aaa", "1", None)
But I realized it can be solved more easily by your answer.
get_redis_connection("default").set(":1:aaa", "1", None)
Thanks! Have a good day :)
First of all, thank you for offering awesome plug-in. I have one question. Please refer following materials.
[ Pre-Condition ] OS : Ubuntu 12.04.5 LTS (GNU/Linux 3.2.0-34-generic-pae i686) django==1.5.4 redis==2.2.12 django-redis==3.7.1
[ django-settings ]
[ django pyshell (./manage.py shell) ]
[ django admin (django-redisboard) ]
[ Problem ]