title: How to get form postdata that uses field names with square brackets as structured objects in Django?
body: <p>I have such a form:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;form action="{% url 'requerimento' %}" method="post" enctype="multipart/form-data"&gt;
      {% csrf_token %}
      &lt;input type="text" name="requerente[nome]"&gt;
      &lt;input type="text" name="requerente[endereco]"&gt;
      &lt;input type="text" name="representante[nome]"&gt;
      &lt;input type="text" name="representante[endereco]"&gt;
      &lt;input type="file" name="anexo[0]"&gt;
      &lt;input type="file" name="anexo[1]"&gt;
      &lt;button type="submit"&gt;Enviar&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>It is evaluated by this view:</p>
  
  <pre class="lang-py prettyprint-override"><code>def teste(request):
      if request.method == 'POST':
          if request.POST:
              pp(request.POST.dict())
          if request.FILES:
              pp(request.FILES.dict())
      return render(request, 'interface/teste.html')
  </code></pre>
  
  <p>It outputs this to console:</p>
  
  <pre><code>{'csrfmiddlewaretoken': 'iEokZx8pJz73BtT8nNiIPH9oBkepgFLN5AfgBTgGstg4WixbBG3gF1XeELVvEUW3',
   'requerente[nome]': 'a',
   'requerente[endereco]': 'b',
   'representante[nome]': 'c',
   'representante[endereco]': 'd'}
  {'anexo[0]': &lt;InMemoryUploadedFile: file1.pdf (application/pdf)&gt;,
   'anexo[1]': &lt;InMemoryUploadedFile: file2.pdf (application/pdf)&gt;}
  </code></pre>
  
  <p><em><strong>Is it possible, instead, to retrieve or easily convert these data in a structured fashion so like below?</strong></em></p>
  
  <pre><code>{'csrfmiddlewaretoken': 'iEokZx8pJz73BtT8nNiIPH9oBkepgFLN5AfgBTgGstg4WixbBG3gF1XeELVvEUW3',
   'requerente': {'nome': 'a', 'endereco': 'b'},
   'representante': {'nome': 'a', 'endereco': 'd'} }
  {'anexo': [
      &lt;InMemoryUploadedFile: file1.pdf (application/pdf)&gt;,
      &lt;InMemoryUploadedFile: file2.pdf (application/pdf)&gt; ]}
  </code></pre>