Пример #1
0
def convert_column_to_int_or_id(type, column, registry=None):
    if column.primary_key or column.foreign_keys:
        return graphene.ID(
            description=get_column_doc(column),
            required=not (is_column_nullable(column)),
        )
    else:
        return graphene.Int(
            description=get_column_doc(column),
            required=not (is_column_nullable(column)),
        )
Пример #2
0
def convert_json_to_generic_scalar(type, column, registry=None):
    return GenericScalar(
        description=get_column_doc(column),
        required=not(is_column_nullable(column)))
Пример #3
0
def convert_column_to_string(type, column, registry=None):
    return String(description=get_column_doc(column),
                  required=not (is_column_nullable(column)))
Пример #4
0
def _convert_geometry(thetype, column, registry=None):
    return GeoJSON(description=get_column_doc(column),
                   required=not (is_column_nullable(column)))
Пример #5
0
def _convert_datetime(thetype, column, registry=None):
    return DateTime(description=get_column_doc(column),
                    required=not (is_column_nullable(column)))
Пример #6
0
def convert_column_to_dict(type, column, registry=None):
    return PassThroughType(description=get_column_doc(column),
                           required=not(is_column_nullable(column)))