summaryrefslogtreecommitdiff
path: root/redis/client.py
diff options
context:
space:
mode:
authorJacob Kaplan-Moss <jacob@jacobian.org>2010-10-20 17:15:00 -0500
committerJacob Kaplan-Moss <jacob@jacobian.org>2010-10-20 17:15:00 -0500
commit6eeee751a90779d65d45165279dc21dae399ac7a (patch)
tree3982987c05cbd952d720797a4b1f28c72f0c83fd /redis/client.py
parent894c48b0979c4d07e6bc4fcf4366c7a71a41de71 (diff)
downloadredis-py-6eeee751a90779d65d45165279dc21dae399ac7a.tar.gz
Adds the ability to get multiple external keys in a sort.
Diffstat (limited to 'redis/client.py')
-rw-r--r--redis/client.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/redis/client.py b/redis/client.py
index 0cc3243..1274228 100644
--- a/redis/client.py
+++ b/redis/client.py
@@ -891,8 +891,17 @@ class Redis(threading.local):
pieces.append(start)
pieces.append(num)
if get is not None:
- pieces.append('GET')
- pieces.append(get)
+ # If get is a string assume we want to get a single value.
+ # Otherwise assume it's an interable and we want to get multiple
+ # values. We can't just iterate blindly because strings are
+ # iterable.
+ if isinstance(get, basestring):
+ pieces.append('GET')
+ pieces.append(get)
+ else:
+ for g in get:
+ pieces.append('GET')
+ pieces.append(g)
if desc:
pieces.append('DESC')
if alpha: