<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: André Alves de Araújo</title>
    <description>The latest articles on DEV Community by André Alves de Araújo (@andrealvesaraujo).</description>
    <link>https://dev.to/andrealvesaraujo</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F829175%2Fea174cef-705a-4639-9ec4-2ebd1c60174d.jpeg</url>
      <title>DEV Community: André Alves de Araújo</title>
      <link>https://dev.to/andrealvesaraujo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/andrealvesaraujo"/>
    <language>en</language>
    <item>
      <title>[HELP] How to generate a list of request.POST in Django</title>
      <dc:creator>André Alves de Araújo</dc:creator>
      <pubDate>Tue, 26 Jul 2022 20:29:00 +0000</pubDate>
      <link>https://dev.to/andrealvesaraujo/how-to-generate-a-list-of-requestpost-in-django-ac4</link>
      <guid>https://dev.to/andrealvesaraujo/how-to-generate-a-list-of-requestpost-in-django-ac4</guid>
      <description>&lt;p&gt;Hello there!!! Plz help my friend. Take a look at his question.&lt;/p&gt;


&lt;div class="ltag__stackexchange--container"&gt;
  &lt;div class="ltag__stackexchange--title-container"&gt;
    
      &lt;div class="ltag__stackexchange--title"&gt;
        &lt;div class="ltag__stackexchange--header"&gt;
          &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7Gn-iPj_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/stackoverflow-logo-b42691ae545e4810b105ee957979a853a696085e67e43ee14c5699cf3e890fb4.svg" alt=""&gt;
          &lt;a href="https://stackoverflow.com/questions/73117453/how-to-generate-a-list-of-request-post-in-django" rel="noopener noreferrer"&gt;
            How to generate a list of request.POST in Django
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="ltag__stackexchange--post-metadata"&gt;
          &lt;span&gt;Jul 26 '22&lt;/span&gt;
            &lt;span&gt;Comments: 4&lt;/span&gt;
            &lt;span&gt;Answers: 2&lt;/span&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;a class="ltag__stackexchange--score-container" href="https://stackoverflow.com/questions/73117453/how-to-generate-a-list-of-request-post-in-django" rel="noopener noreferrer"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Y9mJpuJP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/stackexchange-arrow-up-eff2e2849e67d156181d258e38802c0b57fa011f74164a7f97675ca3b6ab756b.svg" alt=""&gt;
        &lt;div class="ltag__stackexchange--score-number"&gt;
          0
        &lt;/div&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wif5Zq3z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/stackexchange-arrow-down-4349fac0dd932d284fab7e4dd9846f19a3710558efde0d2dfd05897f3eeb9aba.svg" alt=""&gt;
      &lt;/a&gt;
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--body"&gt;
    
&lt;p&gt;I have the following code in views.py:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;def valores(request)
    global peso_unitario, preco_unitario
    peso_unitario=[]
    preco_unitario=[]

    N=a
    print('N='+str(N))

    for i in range(N):
        peso_u = request.POST['peso_u']
        preco_u = request.POST['preco_u']

        if peso_u.isdigit() and preco_u.isdigit():
            c = int(peso_u)
            d = int(preco_u)
            peso_unitario.append(c)
            preco_unitario.append(d)
            print(a)
            if i==N-1:
                return render(request, 'pacote.html', {'peso_unitario': peso_unitario, 'preco_unitario': preco_unitario})
        else:
            res&lt;/code&gt;&lt;/pre&gt;…
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--btn--container"&gt;
    &lt;a href="https://stackoverflow.com/questions/73117453/how-to-generate-a-list-of-request-post-in-django" class="ltag__stackexchange--btn" rel="noopener noreferrer"&gt;Open Full Question&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;


</description>
      <category>python</category>
      <category>django</category>
    </item>
  </channel>
</rss>
