query_cache: Assert that the decorated function starts with get_.

This commit is contained in:
Neil Williams
2012-10-09 22:47:49 -07:00
parent 30b404005e
commit 2ef0a7f452

View File

@@ -252,6 +252,7 @@ def cached_query(model, filter_fn=filter_identity, sort=None):
def cached_query_decorator(fn):
def cached_query_wrapper(*args):
# build the row key from the function name and arguments
assert fn.__name__.startswith("get_")
row_key_components = [fn.__name__[len('get_'):]]
if len(args) > 0: