core.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:edd 作者: JBEI 项目源码 文件源码
def line_strain_changed(sender, instance, action, reverse, model, pk_set, using, **kwargs):
    """
    Handles changes to the Line <-> Strain relationship caused by adding/removing/changing the
    strain associated with a single line in a study. Detects changes that indicate a need to push
    changes across to ICE for the (ICE part -> EDD study) link stored in ICE.
    """
    # only care about changes in the forward direction, Line -> Strain
    if reverse or check_ice_cannot_proceed():
        return
    # only execute these signals if using a non-testing database
    if using in settings.DATABASES:
        action_function = {
            'post_add': strain_added,
            'pre_remove': strain_removing,
            'post_remove': strain_removed,
        }.get(action, None)
        if action_function:
            action_function(instance, pk_set)


# ----- helper functions -----
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号