Created a __str__ to turn objects into strings in models.py.

Searched for the latest price/most recent price in views.py.
Removed excess input field in auction.html.
parent 38180071
......@@ -78,7 +78,6 @@ a{% extends 'boodlesite\templates\base.html' %}
<label for="recipient-name" class="col-form-label">Enter Bid amount:</label>
{% csrf_token %}
{{ form }}
<input type="number" class="form-control" id="amount">
{% if form.amount.errors %}
<ol>
{% for error in form.amount.errors %}
......@@ -108,6 +107,7 @@ a{% extends 'boodlesite\templates\base.html' %}
{% for bid in auction_bids %}
<li><img src="" alt="">
<p>User offered {{ bid.amount }}</p>
<p> &nbsp | &nbsp </p>
<p>{{bid.bidtime | timesince}} ago </p>
</li>
......
......@@ -30,6 +30,9 @@ class AuctionBid(models.Model):
class Meta:
managed = False
db_table = 'auctionbid'
def __str__(self):
return '%d' % (self.amount)
class AuthGroup(models.Model):
......
......@@ -45,6 +45,9 @@ def auction(request, pk):
else:
highest_bid = auction_bids[0]
print("This is the auction bids: ", auction_bids)
prev_amt = AuctionBid.objects.latest('amount');
print(prev_amt)
form = PlaceBidForm()
if request.method == 'POST':
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment