- def query(data):
- return {'name': data.name}
-
- def error(data):
- message = '{} already exists as a pod'.format(data.name)
- return constants.HTTP_FORBIDDEN, message
-
- miss_checks = ['name']
- db_checks = [(self.table, False, query, error)]
- self._create(miss_checks, db_checks)
+ def query():
+ return {'name': self.json_args.get('name')}
+ miss_fields = ['name']
+ self._create(miss_fields=miss_fields, query=query)