• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python db.save_in_bulk函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中taiga.base.utils.db.save_in_bulk函数的典型用法代码示例。如果您正苦于以下问题:Python save_in_bulk函数的具体用法?Python save_in_bulk怎么用?Python save_in_bulk使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: create_related_userstories_in_bulk

def create_related_userstories_in_bulk(bulk_data, epic, **additional_fields):
    """Create user stories from `bulk_data`.

    :param epic: Element where all the user stories will be contained
    :param bulk_data: List of user stories in bulk format.
    :param additional_fields: Additional fields when instantiating each user story.

    :return: List of created `Task` instances.
    """
    userstories = get_userstories_from_bulk(bulk_data, **additional_fields)
    disconnect_userstories_signals()

    try:
        db.save_in_bulk(userstories)
        related_userstories = []
        for userstory in userstories:
            related_userstories.append(
                models.RelatedUserStory(
                    user_story=userstory,
                    epic=epic
                )
            )
        db.save_in_bulk(related_userstories)
    finally:
        connect_userstories_signals()

    return related_userstories
开发者ID:maniacs-satm,项目名称:taiga-back,代码行数:27,代码来源:services.py


示例2: test_save_in_bulk

def test_save_in_bulk():
    instance = mock.Mock()
    instances = [instance, instance]

    save_in_bulk(instances)

    assert instance.save.call_count == 2
开发者ID:6ft,项目名称:taiga-back,代码行数:7,代码来源:test_utils.py


示例3: test_save_in_bulk_with_a_callback

def test_save_in_bulk_with_a_callback():
    instance = mock.Mock()
    callback = mock.Mock()
    instances = [instance, instance]

    save_in_bulk(instances, callback)

    assert callback.call_count == 2
开发者ID:6ft,项目名称:taiga-back,代码行数:8,代码来源:test_utils.py


示例4: create_members_in_bulk

def create_members_in_bulk(bulk_data, callback=None, precall=None, **additional_fields):
    """Create members from `bulk_data`.

    :param bulk_data: List of dicts `{"project_id": <>, "role_id": <>, "email": <>}`.
    :param callback: Callback to execute after each task save.
    :param additional_fields: Additional fields when instantiating each task.

    :return: List of created `Member` instances.
    """
    members = get_members_from_bulk(bulk_data, **additional_fields)
    db.save_in_bulk(members, callback, precall)
    return members
开发者ID:6ft,项目名称:taiga-back,代码行数:12,代码来源:members.py


示例5: create_tasks_in_bulk

def create_tasks_in_bulk(bulk_data, callback=None, precall=None, **additional_fields):
    """Create tasks from `bulk_data`.

    :param bulk_data: List of tasks in bulk format.
    :param callback: Callback to execute after each task save.
    :param additional_fields: Additional fields when instantiating each task.

    :return: List of created `Task` instances.
    """
    tasks = get_tasks_from_bulk(bulk_data, **additional_fields)
    db.save_in_bulk(tasks, callback, precall)
    return tasks
开发者ID:6ft,项目名称:taiga-back,代码行数:12,代码来源:services.py


示例6: create_userstories_in_bulk

def create_userstories_in_bulk(bulk_data, callback=None, precall=None, **additional_fields):
    """Create user stories from `bulk_data`.

    :param bulk_data: List of user stories in bulk format.
    :param callback: Callback to execute after each user story save.
    :param additional_fields: Additional fields when instantiating each user story.

    :return: List of created `Task` instances.
    """
    userstories = get_userstories_from_bulk(bulk_data, **additional_fields)
    db.save_in_bulk(userstories, callback, precall)
    return userstories
开发者ID:benzaku,项目名称:taiga-back,代码行数:12,代码来源:services.py


示例7: create_issues_in_bulk

def create_issues_in_bulk(bulk_data, callback=None, precall=None, **additional_fields):
    """Create issues from `bulk_data`.

    :param bulk_data: List of issues in bulk format.
    :param callback: Callback to execute after each issue save.
    :param additional_fields: Additional fields when instantiating each issue.

    :return: List of created `Issue` instances.
    """
    issues = get_issues_from_bulk(bulk_data, **additional_fields)
    db.save_in_bulk(issues, callback, precall)
    return issues
开发者ID:Type-of-Teamlab,项目名称:taiga-back,代码行数:12,代码来源:services.py


示例8: create_epics_in_bulk

def create_epics_in_bulk(bulk_data, callback=None, precall=None, **additional_fields):
    """Create epics from `bulk_data`.

    :param bulk_data: List of epics in bulk format.
    :param callback: Callback to execute after each epic save.
    :param additional_fields: Additional fields when instantiating each epic.

    :return: List of created `Epic` instances.
    """
    epics = get_epics_from_bulk(bulk_data, **additional_fields)

    disconnect_epics_signals()

    try:
        db.save_in_bulk(epics, callback, precall)
    finally:
        connect_epics_signals()

    return epics
开发者ID:maniacs-satm,项目名称:taiga-back,代码行数:19,代码来源:services.py


示例9: create_userstories_in_bulk

def create_userstories_in_bulk(bulk_data, callback=None, precall=None, **additional_fields):
    """Create user stories from `bulk_data`.

    :param bulk_data: List of user stories in bulk format.
    :param callback: Callback to execute after each user story save.
    :param additional_fields: Additional fields when instantiating each user story.

    :return: List of created `Task` instances.
    """
    userstories = get_userstories_from_bulk(bulk_data, **additional_fields)
    project = additional_fields.get("project")
    disconnect_userstories_signals()

    try:
        db.save_in_bulk(userstories, callback, precall)
        project.update_role_points(user_stories=userstories)
    finally:
        connect_userstories_signals()

    return userstories
开发者ID:shreeshreee,项目名称:taiga-back,代码行数:20,代码来源:services.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python db.to_tsquery函数代码示例发布时间:2022-05-27
下一篇:
Python db.get_typename_for_model_instance函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap