+ def cache_key(self):
+ return self._generate_cache_key("%s:%s" % (self.user.id, self.key))
+
+ @classmethod
+ def infer_cache_key(cls, querydict):
+ if 'user' in querydict and 'key' in querydict:
+ return cls._generate_cache_key("%s:%s" % (querydict['user'].id, querydict['key']))
+
+ return None
+