title: My Django Python code is not changing the database record
body: <p>I'm creating an auction site and I want to be able to change the data in a table to change the price to the new bid. I'm kind of new to Django and Python so I must be missing something.  Right now I'm not getting any errors - it's just not changing the data in the DB.  Does anyone see the issue?</p>
  <p>Here is my HTML and Python code (the relevant parts).  I also added the urls.py file in case something needs to be added there for bid?  I don't think so since it's not linking to another page.</p>
  <p>urls.py :</p>
  <pre><code>urlpatterns = [
      path(&quot;&quot;, views.index, name=&quot;index&quot;),
      path(&quot;login&quot;, views.login_view, name=&quot;login&quot;),
      path(&quot;logout&quot;, views.logout_view, name=&quot;logout&quot;),
      path(&quot;register&quot;, views.register, name=&quot;register&quot;),
      path(&quot;auction&quot;, views.auction, name=&quot;auction&quot;),
      path(&quot;watchlist/&lt;str:username&gt;&quot;, views.watchlist, name=&quot;watchlist&quot;),
      path(&quot;categories&quot;, views.categories, name=&quot;categories&quot;),
      path(&quot;post/&lt;str:title&gt;&lt;str:description&gt;&lt;int:price&gt;&lt;str:category&gt;&quot;, views.post, name=&quot;post&quot;),
      path(&quot;bid/&lt;str:username&gt;&quot;, views.bid, name=&quot;bid&quot;)
  ]
  </code></pre>
  <p>views.py:</p>
  <pre><code>def bid(request, username):
      print(username)
      price = request.POST.get(&quot;price&quot;)
      itemID = request.POST.get(&quot;itemID&quot;)
      newBid = request.POST.get(&quot;newBid&quot;)
      title = request.POST.get(&quot;title&quot;)
      
      query = Bid.objects.filter(itemID = itemID).first()
      
      if(newBid &gt; price and username != query.highestBidder):
          query2 = NewPost.objects.filter(title = title).update(price = newBid)
          new = Bid.objects.create(itemID = itemID, newBid = newBid, highestBidder = username)
          new.save()
      
      query3 = Bid.objects.all()
      print(query3)
      return render(request, &quot;auctions/post.html&quot;)
  </code></pre>
  <p>models.py:</p>
  <pre><code>class Bid(models.Model):
      itemID = models.CharField(max_length=64)
      newBid = models.IntegerField()
      highestBidder = models.CharField(max_length=64)
  </code></pre>
  <p>post.html:</p>
  <pre><code>&lt;h2&gt;{{ p.title }} - Category: {{ p.category }}&lt;/h2&gt;
  &lt;p&gt;Price = ${{ p.price }}&lt;/p&gt; &lt;div&gt;
          {% if user.is_authenticated %}
      &lt;form name=&quot;bid&quot;
            action=&quot;/bid/{{user.username}}&quot;
            method=&quot;post&quot; &gt;
              {% csrf_token %}
              &lt;input autofocus class=&quot;form-control&quot; type=&quot;text&quot; name=&quot;newBid&quot; placeholder=&quot;Enter New Bid&quot;&gt;
              &lt;input autofocus class=&quot;form-control&quot; type=&quot;hidden&quot; name=&quot;itemID&quot; value={{p.title}}{{p.price}}&gt;
              &lt;input autofocus class=&quot;form-control&quot; type=&quot;hidden&quot; name=&quot;price&quot; value={{p.price}}&gt;
              &lt;input autofocus class=&quot;form-control&quot; type=&quot;hidden&quot; name=&quot;title&quot; value={{p.title}}&gt;
              &lt;input class=&quot;btn btn-primary&quot; type=&quot;submit&quot; value=&quot;Place Bid&quot;&gt;
      &lt;/form&gt;
  </code></pre>