当前位置: 首页>>代码示例>>Python>>正文


Python IonObject._validate方法代码示例

本文整理汇总了Python中pyon.public.IonObject._validate方法的典型用法代码示例。如果您正苦于以下问题:Python IonObject._validate方法的具体用法?Python IonObject._validate怎么用?Python IonObject._validate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pyon.public.IonObject的用法示例。


在下文中一共展示了IonObject._validate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: create_ion_object

# 需要导入模块: from pyon.public import IonObject [as 别名]
# 或者: from pyon.public.IonObject import _validate [as 别名]
def create_ion_object(object_params):
    new_obj = IonObject(object_params["type_"])

    #Iterate over the parameters to add to object; have to do this instead
    #of passing a dict to get around restrictions in object creation on setting _id, _rev params
    for param in object_params:
        set_object_field(new_obj, param, object_params.get(param))

    new_obj._validate() # verify that all of the object fields were set with proper types
    return new_obj
开发者ID:swarbhanu,项目名称:coi-services,代码行数:12,代码来源:service_gateway_service.py

示例2: create_ion_object

# 需要导入模块: from pyon.public import IonObject [as 别名]
# 或者: from pyon.public.IonObject import _validate [as 别名]
    def create_ion_object(self, object_params):
        """Create and initialize an ION object from a dictionary of parameters coming via HTTP,
        ready to be passed on to services/messaging. The object is validated after creation.
        Note: This is not called for service operation argument signatures
        """
        new_obj = IonObject(object_params["type_"])

        # Iterate over the parameters to add to object; have to do this instead
        # of passing a dict to get around restrictions in object creation on setting _id, _rev params
        for param in object_params:
            self.set_object_field(new_obj, param, object_params.get(param))

        new_obj._validate()  # verify that all of the object fields were set with proper types
        return new_obj
开发者ID:IvanHreskiv,项目名称:scioncc,代码行数:16,代码来源:service_gateway.py


注:本文中的pyon.public.IonObject._validate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。