def add(self, stats, name, level): """Add item to the list.""" self.append(( FILTERS.get_filter_query(name), FILTERS.get_filter_name(name), getattr(stats, name), level, getattr(stats, '{}_words'.format(name)), ))
def get_search_query_choices(self): """Return all filtering choices for query field.""" filter_keys = [ "nottranslated", "todo", "translated", "fuzzy", "suggestions", "variants", "labels", "context", "nosuggestions", "comments", "allchecks", "approved", "unapproved", ] result = [(key, FILTERS.get_filter_name(key), FILTERS.get_filter_query(key)) for key in filter_keys] return result