title: Accessing form.cleaned_data in get method in class based views
body: <p>I have a situation where I should first display a form to the user where the user fill in two fields and after that base on the form fields I query database and show the user a list of objects. <br/>
  But the problem is I use class based views and I can't access to the cleaned data in my get method. I know that the forms must be handled in post methods not get methods so I can't process form in my get method. <br/>
  Here is my code: <br/></p>
  
  <p><strong>views.py</strong> <br/></p>
  
  <pre><code>class IncomeTransactionReport(LoginRequiredMixin, ListView):
      def post(self, request, *args, **kwargs):
          # here I get form from post request
          form = IncomeReportForm(request.POST)
          # if form is valid redirect user to the same page to show the results based on the filled
          # in form  fields 'from_date' and 'to_date'
          if form.is_valid():
              from_date = form.cleaned_data['from_date']
              to_date = form.cleaned_data['to_date']
              return redirect('income_report')
          # else render the same page with the form and form errors
          else:
              error_message = 'Please solve the error and try again'
              return render(request, 'report_income.html', context={'error_message': error_message,
              'form': form}, status=422)
  
      def get(self, request, *args, **kwargs):
          # here I need to access 'from_date' and 'to_date' to query the database and show the results
          # in paginated pages to the user
          if from_date != None and to_date != None:
              incomes = Income.objects.filter(user=user,
              date__gte=datetime.date.fromisoformat(from_date),
              date__lte=datetime.date.fromisoformat(to_date)).all()
          elif from_date != None:
              incomes = Income.objects.filter(user=user,
              date__gte=datetime.date.fromisoformat(from_date),
              date__lte=datetime.date.fromisoformat(from_date) + \
              relativedelta.relativedelta(months=+1)).all()
          else:
              incomes = Income.objects.filter(user=user).all()
          page = request.POST.get('page', 1)
          paginator = Paginator(incomes, 5)
          try:
              incomes = paginator.page(page)
          except PageNotAnInteger:
              incomes = paginator.page(1)
          except EmptyPage:
              incomes = paginator.page(paginator.num_pages)
          message = 'This is your requested list of incomes'
          # here I return the results
          return render(request, 'report_income.html', {'message': message, 'incomes': incomes})
  </code></pre>
  
  <p>I you need more information please let me know to post it here.</p>