def choices_for_condition_field(self, is_multichoice): condition_choices = {} for key, value in CONDITIONS.items(): is_equals_option = (key == 'EQUALS_OPTION') if (is_equals_option and is_multichoice) or (not is_equals_option and not is_multichoice): condition_choices[key] = value return sorted(condition_choices.items())
def choices_for_condition_field(self, is_multichoice): condition_choices = {} for key, value in CONDITIONS.items(): is_equals_option = (key == 'EQUALS_OPTION') if (is_equals_option and is_multichoice) or (not is_equals_option and not is_multichoice): condition_choices[key] = value return sorted(condition_choices.items())
def condition_text(key): value = CONDITIONS.get(key, "") return value
def condition_text(key): value = CONDITIONS.get(key, "") return value