diff options
author | Milo Casagrande <milo.casagrande@linaro.org> | 2014-05-13 15:52:40 +0200 |
---|---|---|
committer | Milo Casagrande <milo.casagrande@linaro.org> | 2014-05-13 15:52:40 +0200 |
commit | 2f9c509495aaf0f89c10d5d3b1f9fd0944a54cc3 (patch) | |
tree | 97192c3fa64e89565c3276ff0eb59d20cfb618a7 | |
parent | 6ad6944fd06c765770c816418cecb3efcfca3139 (diff) |
Add valid GET keys, remove subscription collection.
-rw-r--r-- | app/handlers/count.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/app/handlers/count.py b/app/handlers/count.py index d133a1c..6829c36 100644 --- a/app/handlers/count.py +++ b/app/handlers/count.py @@ -26,7 +26,6 @@ from handlers.base import BaseHandler from models.boot import BOOT_COLLECTION from models.defconfig import DEFCONFIG_COLLECTION from models.job import JOB_COLLECTION -from models.subscription import SUBSCRIPTION_COLLECTION from utils.db import count # All the available collections as key-value. The key is the same used for the @@ -35,7 +34,6 @@ COLLECTIONS = { 'boot': BOOT_COLLECTION, 'defconfig': DEFCONFIG_COLLECTION, 'job': JOB_COLLECTION, - 'subscription': SUBSCRIPTION_COLLECTION, } @@ -45,6 +43,17 @@ class CountHandler(BaseHandler): def __init__(self, application, request, **kwargs): super(CountHandler, self).__init__(application, request, **kwargs) + def _valid_keys(self, method): + valid_keys = { + # This is a set of all the valid fields in the available models. + 'GET': [ + 'job', 'kernel', 'status', 'private', 'created', + 'defconfig', 'board', 'time', 'warnings', + ], + } + + return valid_keys.get(method, None) + @asynchronous def get(self, *args, **kwargs): if kwargs and kwargs.get('collection', None): |