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


Python Form.from_dict方法代码示例

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


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

示例1: from_dict

# 需要导入模块: from form import Form [as 别名]
# 或者: from form.Form import from_dict [as 别名]
    def from_dict(job_dict):
        job_dict.setdefault("connector", [])
        job_dict["connector"] = [Form.from_dict(con_form_dict) for con_form_dict in job_dict["connector"]]

        job_dict.setdefault("framework", [])
        job_dict["framework"] = [Form.from_dict(framework_form_dict) for framework_form_dict in job_dict["framework"]]

        if not "connection_id" in job_dict:
            job_dict["connection_id"] = job_dict["connection-id"]

        if not "connector_id" in job_dict:
            job_dict["connector_id"] = job_dict["connector-id"]

        if not "creation_user" in job_dict:
            job_dict["creation_user"] = job_dict.setdefault("creation-user", "hue")

        if not "creation_date" in job_dict:
            job_dict["creation_date"] = job_dict.setdefault("creation-date", 0)

        if not "update_user" in job_dict:
            job_dict["update_user"] = job_dict.setdefault("update-user", "hue")

        if not "update_date" in job_dict:
            job_dict["update_date"] = job_dict.setdefault("update-date", 0)

        return Job(**force_dict_to_strings(job_dict))
开发者ID:Kewtt,项目名称:hue,代码行数:28,代码来源:job.py

示例2: from_dict

# 需要导入模块: from form import Form [as 别名]
# 或者: from form.Form import from_dict [as 别名]
  def from_dict(job_dict):
    job_dict.setdefault('connector', [])
    job_dict['connector'] = [ Form.from_dict(con_form_dict) for con_form_dict in job_dict['connector'] ]

    job_dict.setdefault('framework', [])
    job_dict['framework'] = [ Form.from_dict(framework_form_dict) for framework_form_dict in job_dict['framework'] ]

    if not 'connection_id' in job_dict:
      job_dict['connection_id'] = job_dict['connection-id']

    if not 'connector_id' in job_dict:
      job_dict['connector_id'] = job_dict['connector-id']

    if not 'creation_user' in job_dict:
      job_dict['creation_user'] = job_dict.setdefault('creation-user', 'hue')

    if not 'creation_date' in job_dict:
      job_dict['creation_date'] = job_dict.setdefault('creation-date', 0)

    if not 'update_user' in job_dict:
      job_dict['update_user'] = job_dict.setdefault('update-user', 'hue')

    if not 'update_date' in job_dict:
      job_dict['update_date'] = job_dict.setdefault('update-date', 0)

    return Job(**job_dict)
开发者ID:Web5design,项目名称:hue,代码行数:28,代码来源:job.py

示例3: from_dict

# 需要导入模块: from form import Form [as 别名]
# 或者: from form.Form import from_dict [as 别名]
  def from_dict(connection_dict):
    connection_dict.setdefault('connector', [])
    connection_dict['connector'] = [ Form.from_dict(con_form_dict) for con_form_dict in connection_dict['connector'] ]

    connection_dict.setdefault('framework', [])
    connection_dict['framework'] = [ Form.from_dict(framework_form_dict) for framework_form_dict in connection_dict['framework'] ]

    if not 'connector_id' in connection_dict:
      connection_dict['connector_id'] = connection_dict.setdefault('connector-id', -1)

    return Connection(**connection_dict)
开发者ID:Jack-coastal,项目名称:hue,代码行数:13,代码来源:connection.py

示例4: from_dict

# 需要导入模块: from form import Form [as 别名]
# 或者: from form.Form import from_dict [as 别名]
  def from_dict(framework_dict):
    framework_dict.setdefault('job-forms', {})
    framework_dict['job_forms'] = {}
    if 'IMPORT' in framework_dict['job-forms']:
      framework_dict['job_forms']['IMPORT'] = [ Form.from_dict(job_form_dict) for job_form_dict in framework_dict['job-forms']['IMPORT'] ]
    if 'EXPORT' in framework_dict['job-forms']:
      framework_dict['job_forms']['EXPORT'] = [ Form.from_dict(job_form_dict) for job_form_dict in framework_dict['job-forms']['EXPORT'] ]

    framework_dict.setdefault('con-forms', [])
    framework_dict['con_forms'] = [ Form.from_dict(con_form_dict) for con_form_dict in framework_dict['con-forms'] ]

    return Framework(**framework_dict)
开发者ID:Jack-coastal,项目名称:hue,代码行数:14,代码来源:framework.py

示例5: from_dict

# 需要导入模块: from form import Form [as 别名]
# 或者: from form.Form import from_dict [as 别名]
  def from_dict(job_dict):
    job_dict.setdefault('connector', [])
    job_dict['connector'] = [ Form.from_dict(con_form_dict) for con_form_dict in job_dict['connector'] ]

    job_dict.setdefault('framework', [])
    job_dict['framework'] = [ Form.from_dict(framework_form_dict) for framework_form_dict in job_dict['framework'] ]

    if not 'connection_id' in job_dict:
      job_dict['connection_id'] = job_dict['connection-id']

    if not 'connector_id' in job_dict:
      job_dict['connector_id'] = job_dict['connector-id']

    return Job(**job_dict)
开发者ID:Roxasora,项目名称:hue,代码行数:16,代码来源:job.py

示例6: from_dict

# 需要导入模块: from form import Form [as 别名]
# 或者: from form.Form import from_dict [as 别名]
  def from_dict(connector_dict, resources_dict={}):
    connector_dict.setdefault('job-forms', {})
    connector_dict['job_forms'] = {}
    if 'IMPORT' in connector_dict['job-forms']:
      connector_dict['job_forms']['IMPORT'] = [ Form.from_dict(job_form_dict) for job_form_dict in connector_dict['job-forms']['IMPORT'] ]
    if 'EXPORT' in connector_dict['job-forms']:
      connector_dict['job_forms']['EXPORT'] = [ Form.from_dict(job_form_dict) for job_form_dict in connector_dict['job-forms']['EXPORT'] ]

    connector_dict.setdefault('con-forms', [])
    connector_dict['con_forms'] = [ Form.from_dict(con_form_dict) for con_form_dict in connector_dict['con-forms'] ]

    connector_dict['resources'] = resources_dict.setdefault(unicode(connector_dict['id']), {})

    return Connector(**connector_dict)
开发者ID:Jack-coastal,项目名称:hue,代码行数:16,代码来源:connector.py

示例7: from_dict

# 需要导入模块: from form import Form [as 别名]
# 或者: from form.Form import from_dict [as 别名]
  def from_dict(connection_dict):
    connection_dict.setdefault('connector', [])
    connection_dict['connector'] = [ Form.from_dict(con_form_dict) for con_form_dict in connection_dict['connector'] ]

    connection_dict.setdefault('framework', [])
    connection_dict['framework'] = [ Form.from_dict(framework_form_dict) for framework_form_dict in connection_dict['framework'] ]

    if not 'connector_id' in connection_dict:
      connection_dict['connector_id'] = connection_dict.setdefault('connector-id', -1)

    if not 'creation_user' in connection_dict:
      connection_dict['creation_user'] = connection_dict.setdefault('creation-user', 'hue')

    if not 'creation_date' in connection_dict:
      connection_dict['creation_date'] = connection_dict.setdefault('creation-date', 0)

    if not 'update_user' in connection_dict:
      connection_dict['update_user'] = connection_dict.setdefault('update-user', 'hue')

    if not 'update_date' in connection_dict:
      connection_dict['update_date'] = connection_dict.setdefault('update-date', 0)

    return Connection(**force_dict_to_strings(connection_dict))
开发者ID:2013Commons,项目名称:hue,代码行数:25,代码来源:connection.py


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