def scheming_organization_schema_show(context, data_dict): ''' Return the scheming schema for a given organization type :param type: the organization type ''' t = get_or_bust(data_dict, 'type') s = scheming_get_organization_schema(t) if s is None: raise ObjectNotFound() return s
def get_data_container_choice_label(name, value): schema = scheming_get_organization_schema('data-container') fields = schema['fields'] field = scheming_field_by_name(fields, name) if field: for choice in field.get('choices', []): if choice.get('value') == value: return choice.get('label') return value else: log.warning( 'Could not get field {} from data-container schema'.format(name))
def scheming_organization_schema_show(context, data_dict): """ Return the scheming schema for a given organization type :param type: the organization type :param expanded: True to expand presets (default) """ t = get_or_bust(data_dict, 'type') expanded = data_dict.get('expanded', True) s = scheming_get_organization_schema(t, expanded) if s is None: raise ObjectNotFound() return s
def scheming_organization_schema_show(context, data_dict): ''' Return the scheming schema for a given organization type :param type: the organization type :param expanded: True to expand presets (default) ''' t = get_or_bust(data_dict, 'type') expanded = data_dict.get('expanded', True) s = scheming_get_organization_schema(t, expanded) if s is None: raise ObjectNotFound() return s