當前位置: 首頁>>代碼示例>>Python>>正文


Python graphene.Float方法代碼示例

本文整理匯總了Python中graphene.Float方法的典型用法代碼示例。如果您正苦於以下問題:Python graphene.Float方法的具體用法?Python graphene.Float怎麽用?Python graphene.Float使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在graphene的用法示例。


在下文中一共展示了graphene.Float方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: convert_ndb_float_property

# 需要導入模塊: import graphene [as 別名]
# 或者: from graphene import Float [as 別名]
def convert_ndb_float_property(ndb_prop, registry=None):
    return convert_ndb_scalar_property(Float, ndb_prop) 
開發者ID:graphql-python,項目名稱:graphene-gae,代碼行數:4,代碼來源:converter.py

示例2: testFloatProperty_shouldConvertToString

# 需要導入模塊: import graphene [as 別名]
# 或者: from graphene import Float [as 別名]
def testFloatProperty_shouldConvertToString(self):
        self.__assert_conversion(ndb.FloatProperty, graphene.Float) 
開發者ID:graphql-python,項目名稱:graphene-gae,代碼行數:4,代碼來源:test_converter.py

示例3: convert_column_to_float_or_id

# 需要導入模塊: import graphene [as 別名]
# 或者: from graphene import Float [as 別名]
def convert_column_to_float_or_id(type, attribute, registry=None):
    if attribute.is_hash_key:
        return ID(description=attribute.attr_name, required=not attribute.null)

    return Float(description=attribute.attr_name, required=not attribute.null) 
開發者ID:yfilali,項目名稱:graphql-pynamodb,代碼行數:7,代碼來源:converter.py

示例4: test_should_number_convert_float

# 需要導入模塊: import graphene [as 別名]
# 或者: from graphene import Float [as 別名]
def test_should_number_convert_float():
    assert_attribute_conversion(NumberAttribute(), graphene.Float) 
開發者ID:yfilali,項目名稱:graphql-pynamodb,代碼行數:4,代碼來源:test_converter.py

示例5: __init__

# 需要導入模塊: import graphene [as 別名]
# 或者: from graphene import Float [as 別名]
def __init__(self):
        self._typeMap = {}
        self.Field = create_registry_field(self)
        self.Argument = create_registry_argument(self)
        self.List = create_registry_list(self)
        self.NonNull = create_registry_nonnull(self)
        registering_metaclass = create_registering_metaclass(self)
        self.Union = create_union(registering_metaclass, self)
        self.Enum = create_enum(registering_metaclass)
        self.Mutation = graphene.Mutation

        # Not looping over GRAPHENE_TYPES in order to not fool lint
        self.ObjectType = create_registering_class(graphene.ObjectType, registering_metaclass)
        self.InputObjectType = create_registering_class(
            graphene.InputObjectType, registering_metaclass
        )
        self.Interface = create_registering_class(graphene.Interface, registering_metaclass)
        self.Scalar = create_registering_class(graphene.Scalar, registering_metaclass)

        # Not looping over GRAPHENE_BUILTINS in order to not fool lint
        self.String = graphene.String
        self.addType(graphene.String)
        self.Int = graphene.Int
        self.addType(graphene.Int)
        self.Float = graphene.Float
        self.addType(graphene.Float)
        self.Boolean = graphene.Boolean
        self.addType(graphene.Boolean)
        self.ID = graphene.ID
        self.addType(graphene.ID)
        self.GenericScalar = GenericScalar
        self.addType(GenericScalar) 
開發者ID:dagster-io,項目名稱:dagster,代碼行數:34,代碼來源:dauphin_registry.py

示例6: test_should_float_convert_float

# 需要導入模塊: import graphene [as 別名]
# 或者: from graphene import Float [as 別名]
def test_should_float_convert_float():
    assert get_field(types.Float()).type == graphene.Float 
開發者ID:graphql-python,項目名稱:graphene-sqlalchemy,代碼行數:4,代碼來源:test_converter.py

示例7: convert_field_to_float

# 需要導入模塊: import graphene [as 別名]
# 或者: from graphene import Float [as 別名]
def convert_field_to_float(field, registry=None):
    return graphene.Float(
        description=get_field_description(field, registry), required=field.required
    ) 
開發者ID:graphql-python,項目名稱:graphene-mongo,代碼行數:6,代碼來源:converter.py

示例8: test_should_decimal_convert_float

# 需要導入模塊: import graphene [as 別名]
# 或者: from graphene import Float [as 別名]
def test_should_decimal_convert_float():
    assert_conversion(mongoengine.DecimalField, graphene.Float) 
開發者ID:graphql-python,項目名稱:graphene-mongo,代碼行數:4,代碼來源:test_converter.py

示例9: test_should_float_convert_float

# 需要導入模塊: import graphene [as 別名]
# 或者: from graphene import Float [as 別名]
def test_should_float_convert_float():
    assert_conversion(mongoengine.FloatField, graphene.Float) 
開發者ID:graphql-python,項目名稱:graphene-mongo,代碼行數:4,代碼來源:test_converter.py

示例10: convert_form_field_to_float

# 需要導入模塊: import graphene [as 別名]
# 或者: from graphene import Float [as 別名]
def convert_form_field_to_float(field):
    return Float(description=field.help_text, required=field.required) 
開發者ID:graphql-python,項目名稱:graphene-django,代碼行數:4,代碼來源:converter.py

示例11: test_should_float_convert_float

# 需要導入模塊: import graphene [as 別名]
# 或者: from graphene import Float [as 別名]
def test_should_float_convert_float():
    assert_conversion(serializers.FloatField, graphene.Float) 
開發者ID:graphql-python,項目名稱:graphene-django,代碼行數:4,代碼來源:test_field_converter.py

示例12: test_should_decimal_convert_float

# 需要導入模塊: import graphene [as 別名]
# 或者: from graphene import Float [as 別名]
def test_should_decimal_convert_float():
    assert_conversion(
        serializers.DecimalField, graphene.Float, max_digits=4, decimal_places=2
    ) 
開發者ID:graphql-python,項目名稱:graphene-django,代碼行數:6,代碼來源:test_field_converter.py

示例13: test_should_auto_convert_duration

# 需要導入模塊: import graphene [as 別名]
# 或者: from graphene import Float [as 別名]
def test_should_auto_convert_duration():
    assert_conversion(models.DurationField, graphene.Float) 
開發者ID:graphql-python,項目名稱:graphene-django,代碼行數:4,代碼來源:test_converter.py

示例14: test_should_float_convert_float

# 需要導入模塊: import graphene [as 別名]
# 或者: from graphene import Float [as 別名]
def test_should_float_convert_float():
    assert_conversion(models.FloatField, graphene.Float) 
開發者ID:graphql-python,項目名稱:graphene-django,代碼行數:4,代碼來源:test_converter.py


注:本文中的graphene.Float方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。