signals.py 文件源码

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

项目:a4-meinberlin 作者: liqd 项目源码 文件源码
def log_module_component_changes(sender, module, component, user, **kwargs):
    with translation.override(settings.DEFAULT_LANGUAGE):
        message = _(
            '"{username}" modified the component "{component_label}"'
            ' in the module "{module_name}"'
            ' of the project "{project_name}".').format(
                username=user.username,
                project_name=module.project.name,
                module_name=module.name,
                component_label=component.label)

    models.LogEntry.objects.create(
        message=message,
        action=models.MODULE_COMPONENT_UPDATED,
        actor=user,
        component_identifier=component.identifier,
        project=module.project,
        module=module,
    )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号