From 5c772a07dfd37311088eb7285898a2ec9160a4d6 Mon Sep 17 00:00:00 2001 From: Roxas Shadow Date: Sun, 19 Mar 2017 23:53:58 +0100 Subject: [PATCH] Declare variable key in the get_user example As the variable `key` is not defined, the example could generate a little of confusion in my opinion. If we don't want to add more complexity using `format()`, we should be also able to just do `key = "user.{user_id}`. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 0428e309..866972af 100644 --- a/README.md +++ b/README.md @@ -1156,6 +1156,7 @@ def get_user(self, user_id): if user is None: user = db.query("SELECT * FROM users WHERE user_id = {0}", user_id) if user is not None: + key = "user.{0}".format(user_id) cache.set(key, json.dumps(user)) return user ```