示例#1
0
文件: views.py 项目: martifarm/pyas2
 def post(self, request, *args, **kwargs):
     form = self.form_class(request.POST, request.FILES)
     if form.is_valid():
         return HttpResponseRedirect(
             viewlib.url_with_querystring(reverse('mdns'),
                                          **form.cleaned_data))
     else:
         return render(request, self.template_name, {'form': form})
示例#2
0
文件: views.py 项目: kurohai/pyas2
 def post(self, request, *args, **kwargs):
     form = self.form_class(request.POST, request.FILES)
     if form.is_valid():
         return HttpResponseRedirect(viewlib.url_with_querystring(reverse('messages'), **form.cleaned_data))
     else:
         return render(request, self.template_name, {'form': form, 'confirm': False})