client.py 文件源码

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

项目:borgcube 作者: enkore 项目源码 文件源码
def edit_view(self, request):
        client = self.client
        data = request.POST or None
        client.connection._p_activate()
        client_form = Client.Form(data, initial=client.__dict__)
        del client_form.fields['hostname']
        connection_form = RshClientConnection.Form(data, initial=client.connection.__dict__)
        if data and client_form.is_valid() and connection_form.is_valid():
            client._update(client_form.cleaned_data)
            client.connection._update(connection_form.cleaned_data)
            transaction.get().note('Edited client %s' % client.hostname)
            transaction.commit()
            return self.redirect_to()
        return self.render(request, 'core/client/edit.html', {
            'client': client,
            'client_form': client_form,
            'connection_form': connection_form,
        })
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号