title: Proper way to write 'request.POST.post' in class based views
body: <p>I'm trying to use CBV. I'm new to it. I'm having problem requesting a POST data inside a form.</p>
  <p>Here is my view:</p>
  <pre><code>    form_class = LocatarioForm
      template_name = 'contrato/locatario_form.html'
  
  
      def get_initial(self):
          return {
              'contrato': self.kwargs[&quot;pk&quot;]
          }
  
      def post(self, request, pk):
          segundolocatario = request.POST['segundolocatario']
          return segundolocatario
  
      def get_success_url(request):
          # if request.POST.post('segundolocatario') == 'Sim'
          #     return reverse('contrato:locatario', kwargs={'pk': self.object.pk})
          return reverse('contrato:conjugec', kwargs={'pk': self.object.pk})
  </code></pre>
  <p>Here is the template:</p>
  <pre><code>                &lt;form method=&quot;post&quot;&gt;
                      {% csrf_token %}
                      {{form}}
                      
                      &lt;label for=&quot;segundolocatario&quot;&gt;Deseja cadastrar um segundo locatário para este contrato?&lt;/label&gt;
                      &lt;select name=&quot;segundolocatario&quot; id=&quot;&quot;&gt;
                          &lt;option value=&quot;sim&quot;&gt;Sim&lt;/option&gt;
                          &lt;option value=&quot;nao&quot;&gt;Não&lt;/option&gt;
                      &lt;/select&gt;
                      &lt;br&gt;&lt;br&gt;
                      &lt;button type=&quot;submit&quot;&gt;Próxima etapa&lt;/button&gt;
  
                  &lt;/form&gt;
  </code></pre>
  <p>I need to request 'segundolocatario' to flow control my templates.</p>
  <p>How can I do this in CBV?
  Thank you.</p>