title: got an unexpected keyword argument 'id'
body: <p>I'm trying to do a query when the object has the status = 'Opened'. And display in a table where I will have a button to give a solution for my form and change status='Pending'. But when I click in the button I get this error.</p>
  <p>What I'd like to do for really is display was a form for each data, but when I do a for loop for each one form my data insnt show, how you can see <strong>my editable.html</strong>. I just get the buttons to do an action, and they are working fine.</p>
  <p><a href="https://i.stack.imgur.com/Pdtp5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Pdtp5.png" alt="Editale.html" /></a></p>
  <p>url:</p>
  <pre><code> path('manutencao_os_status/&lt;int:id&gt;', views.manutencao_ordem_de_servico, name='manutencao_os_status'),
      path('manutencao_ordem_de_servico/', views.manutencao_ordem_de_servico, name='manutencao_ordem_de_servico'),
  </code></pre>
  <p>views.py</p>
  <pre><code>def manutencao_ordem_de_servico(request):
      ordem_servico = OrdemServico.objects.filter(status='Aberto').order_by('id')
      form = FormOrdemServico(ordem_servico)
  
      if request.method != 'POST':
          return render(request, 'ordemservico/manutencao_ordem_de_servico.html', {
              'form': form,
              'ordem_servico': ordem_servico
          })
  
      form = FormOrdemServico(request.POST, ordem_servico)
  
      if not form.is_valid():
          return render(request, 'ordemservico/manutencao_ordem_de_servico.html', {
              'form': form,
              'ordem_servico': ordem_servico
          })
  
      ordem_servico.save()
  
      return redirect('ordemservico:manutencao_ordem_de_servico')
  
  
  def manutencao_os_status(request, id):
      ordem_servico = OrdemServico.objects.get(pk=id)
      ordem_servico.status = 'Em Aprovação'
  
      ordem_servico.save()
  
      return redirect('ordemservico:manutencao_os_status')
  </code></pre>
  <p>html:</p>
  <pre><code> {%extends 'base.html' %}
      
      {%block conteudo %}
      &lt;h1&gt;Ordens de Serviço&lt;/h1&gt;
      
      &lt;section class=&quot;content&quot;&gt;
          &lt;div class=&quot;container-fluid&quot;&gt;
              &lt;div class=&quot;row&quot;&gt;
                  &lt;div class=&quot;card card-primary&quot;&gt;
                      &lt;div class=&quot;table table-bordered&quot;&gt;
      
                          &lt;table class=&quot;table table-bordered&quot;&gt;
                              &lt;thead&gt;
                              &lt;tr&gt;
                                  &lt;td&gt;Condition:&lt;/td&gt;
                                  &lt;td&gt;ID:&lt;/td&gt;
                                  &lt;td&gt;Name:&lt;/td&gt;
                                  &lt;td&gt;Status:&lt;/td&gt;
                                  &lt;td&gt;Solution:&lt;/td&gt;
                              &lt;/tr&gt;
                              &lt;/thead&gt;
                              &lt;tbody&gt;
                              {% for os in ordem_servico %}
                              &lt;tr&gt;
                                  &lt;td&gt;
                                 &lt;a href=&quot;{% url 'ordemservico:manutencao_os_status' os.id %}&quot;
                                 class=&quot;btn btn-success&quot;&gt;Aprovar&lt;/a&gt;
                                  &lt;/td&gt;
                                  &lt;td&gt;{{os.id}}&lt;/td&gt;
                                  &lt;td&gt;&lt;a href=&quot;{% url 'ordemservico:editar_ordem_de_servico' os.id %}&quot;&gt; {{os.name}}&lt;/a&gt;&lt;/td&gt;
                                 
                                  &lt;td&gt;{{os.status}}&lt;/td&gt;
                                  
                                  &lt;td&gt;{{os.solution}}&lt;/td&gt;
      
                              &lt;/tr&gt;
                              {%endfor%}
                              &lt;/tbody&gt;
                          &lt;/table&gt;
          
          
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/section&gt;
          
          {% endblock %}
  </code></pre>
  <p>my editable.html:</p>
  <pre><code>{%for os in ordem_servico %}
  &lt;form action=&quot;{% url 'ordemservico:manutencao_os_status' os.id  %}&quot; method=&quot;POST&quot; enctype=&quot;multipart/form-data&quot;&gt;
      {% csrf_token %}
      &lt;fieldset&gt;
          &lt;legend&gt;&lt;h2&gt;Ordens de Serviço&lt;/h2&gt;&lt;/legend&gt;
          &lt;table class=&quot;table&quot;&gt;
              {{ os.form }}
              &lt;tr&gt;
                  &lt;td colspan=&quot;2&quot;&gt;
                      &lt;button type=&quot;submit&quot; class=&quot;btn btn-primary&quot;&gt;Solucionar&lt;/button&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
  
          &lt;/table&gt;
  
      &lt;/fieldset&gt;
  &lt;/form&gt;
  {%endfor%}
  {% endblock %}
  </code></pre>