Example #1
0
def get_group_schema(context, data_dict):
    """
    Returns full schema definition for the group `name`.

    :param name: The name of the schema to return.
    :param expanded: Expand schema presets. Defaults to `True`.
    :returns:  A complete dataset schema or 404 if not found.
    :rtype: dict
    """
    schema_name = _get_or_bust(data_dict, 'name')

    expanded = data_dict.get('expanded', True)
    if isinstance(expanded, basestring):
        expanded = True if expanded == 'true' else False

    result = scheming_helpers.scheming_get_group_schema(
        schema_name,
        expanded=expanded
    )

    if result is None:
        raise _NotFound(('no schema by the name {name}'.format(
            name=schema_name
        ),))

    return result
Example #2
0
def get_group_schema(context, data_dict):
    """
    Returns full schema definition for the group `name`.

    :param name: The name of the schema to return.
    :param expanded: Expand schema presets. Defaults to `True`.
    :returns:  A complete dataset schema or 404 if not found.
    :rtype: dict
    """
    schema_name = _get_or_bust(data_dict, 'name')

    expanded = data_dict.get('expanded', True)
    if isinstance(expanded, basestring):
        expanded = True if expanded == 'true' else False

    result = scheming_helpers.scheming_get_group_schema(
        schema_name,
        expanded=expanded
    )

    if result is None:
        raise _NotFound(('no schema by the name {name}'.format(
            name=schema_name
        ),))

    return result
Example #3
0
def scheming_group_schema_show(context, data_dict):
    '''
    Return the scheming schema for a given group type

    :param type: the group type
    '''
    t = get_or_bust(data_dict, 'type')
    s = scheming_get_group_schema(t)
    if s is None:
        raise ObjectNotFound()
    return s
Example #4
0
def scheming_group_schema_show(context, data_dict):
    """
    Return the scheming schema for a given group type

    :param type: the group type
    :param expanded: True to expand presets (default)
    """
    t = get_or_bust(data_dict, 'type')
    expanded = data_dict.get('expanded', True)
    s = scheming_get_group_schema(t, expanded)
    if s is None:
        raise ObjectNotFound()
    return s
Example #5
0
def scheming_group_schema_show(context, data_dict):
    '''
    Return the scheming schema for a given group type

    :param type: the group type
    :param expanded: True to expand presets (default)
    '''
    t = get_or_bust(data_dict, 'type')
    expanded = data_dict.get('expanded', True)
    s = scheming_get_group_schema(t, expanded)
    if s is None:
        raise ObjectNotFound()
    return s