client.py 文件源码

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

项目:borgcube 作者: enkore 项目源码 文件源码
def add_view(self, request):
        data = request.POST or None
        client_form = Client.Form(data)
        connection_form = RshClientConnection.Form(data)
        if data and client_form.is_valid() and connection_form.is_valid():
            connection = RshClientConnection(**connection_form.cleaned_data)
            client = Client(connection=connection, **client_form.cleaned_data)
            transaction.get().note('Added client %s' % client.hostname)
            transaction.commit()
            return self.redirect_to()
        return self.render(request, 'core/client/add.html', {
            'client_form': client_form,
            'connection_form': connection_form,
        })
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号