Commit a0267123 authored by Felizia Tiburcio's avatar Felizia Tiburcio

Display auction item info on page

parent d351f132
...@@ -44,14 +44,10 @@ ...@@ -44,14 +44,10 @@
<div class="product-info" style="border: 2px dotted black;"> <div class="product-info" style="border: 2px dotted black;">
<h2>Product Name</h2> <h2>{{ item_name }} </h2>
<h4>Product Specifications</h4> <h4>Product Specifications</h4>
<p>description description description <p>{{ item_specs }}</p>
description description description
description description description
description description description
description description description</p>
</div> </div>
<button class="btn-place-bid">Place Bid</button> <button class="btn-place-bid">Place Bid</button>
......
...@@ -31,15 +31,20 @@ def auction(request, pk): ...@@ -31,15 +31,20 @@ def auction(request, pk):
# Current auction ID # Current auction ID
auction = Auction.objects.get(pk=pk) auction = Auction.objects.get(pk=pk)
# print('auction', pk, auction) auction_item = auction.itemid
# print(auction.title,auction.info)
context = {
'item_name':auction_item.itemname,
'item_specs': auction_item.itemspecs
}
if auction.auctionend < datetime.now(): if auction.auctionend < datetime.now():
return HttpResponse("This auction has already passed.") return HttpResponse("This auction has already passed.")
elif auction.auctionstart > datetime.now(): elif auction.auctionstart > datetime.now():
return HttpResponse("This auction has not yet started.") return HttpResponse("This auction has not yet started.")
else: else:
return render(request, "boodlesite/templates/auction.html") return render(request, "boodlesite/templates/auction.html",context)
......
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