def get(self, request, *args, **kwargs): form = forms.HelloForm(request.GET or None) d = { 'form': form, 'message': message, } context = super(WorkerListView, self).get_context_data(**kwargs) return render(self.request, self.template_name, context)
def get(self, request, *args, **kwargs): form = forms.HelloForm(request.GET or None) # if form.is_valid(): # message = 'データ検証に成功しました' # else: # message = 'データ検証に失敗しました' d = { 'form': form, # # 'message': message, } context = super(WorkerListView, self).get_context_data(**kwargs) return render(request, 'forms.html', d)
def get(self, request, *args, **kwargs): form = forms.HelloForm(request.GET or None) if form.is_valid(): message = 'データ検証に成功しました' else: message = 'データ検証に失敗しました' d = { 'form': form, 'message': message, } context = super(WorkerListView, self).get_context_data(**kwargs) return render(self.request, self.template_name, context, d)
def get(self, request, *args, **kwargs): form = forms.HelloForm(request.GET or None) print str(form) context = super(WorkerListView, self).get_context_data(**kwargs) return render(self.request, self.template_name, context)