def collection_stage_from_value(x): values = values_list(x, "collection_stage_name") if values: choices = list(choices_from_values(values, CollectionStage.STAGES)) if len(choices) > 0: return choices[0] return None
def project_status_from_statuses(x): values = values_list(x, "project_status_name") if values: choices = list(choices_from_values(values, ProjectStatus.STATUSES)) if len(choices) > 0: return choices[0] return None