Source code for corehq.apps.es.apps

"""
AppES
-----
"""
from . import filters, queries
from .es_query import HQESQuery


[docs]class AppES(HQESQuery): index = 'apps' @property def builtin_filters(self): return [ is_build, is_released, created_from_template, uses_case_sharing, cloudcare_enabled, app_id, ] + super(AppES, self).builtin_filters
[docs]def build_comment(comment): return queries.search_string_query(comment, ['build_comment'])
[docs]def version(version): return filters.term('version', version)
[docs]def is_build(build=True): filter = filters.empty('copy_of') if build: return filters.NOT(filter) return filter
[docs]def is_released(released=True): return filters.term('is_released', released)
[docs]def created_from_template(from_template=True): filter = filters.empty('created_from_template') if from_template: return filters.NOT(filter) return filter
[docs]def uses_case_sharing(case_sharing=True): return filters.term('case_sharing', case_sharing)
[docs]def cloudcare_enabled(cloudcare_enabled): return filters.term('cloudcare_enabled', cloudcare_enabled)
[docs]def app_id(app_id): return filters.term('copy_of', app_id)