Commit f0a2d71d authored by Christine Dela Rosa's avatar Christine Dela Rosa

Edit views.py, Added marker for log-in

parent 7a9fe988
...@@ -41,8 +41,8 @@ def auction(request,pk): ...@@ -41,8 +41,8 @@ def auction(request,pk):
auction_bids = AuctionBid.objects.filter(auctionid=pk).order_by('-bidtime') auction_bids = AuctionBid.objects.filter(auctionid=pk).order_by('-bidtime')
highest_bid = auction_item.floorprice highest_bid = auction_item.floorprice
# who you are logged in as ## ⭐ the user that is logged in
users = BoodleUser.objects.get(userid=3) users = BoodleUser.objects.get(userid=1)
userid = users.userid userid = users.userid
if auction_bids: if auction_bids:
...@@ -210,8 +210,8 @@ def startAuction(request, pk): ...@@ -210,8 +210,8 @@ def startAuction(request, pk):
def tempProfile(request): # temp view def tempProfile(request): # temp view
#### Access to store 1 [ edit accordingly when it becomes accessible thru a user ] #### #### Access to store 1 [ edit accordingly when it becomes accessible thru a user ] ####
user_one =BoodleUser.objects.get(userid=1) user_one =BoodleUser.objects.get(userid=1) # shrek
user_two = BoodleUser.objects.get(userid=3) user_two = BoodleUser.objects.get(userid=3) ## tony
context = { context = {
'user_one':user_one, #### used for navbar, access to user1 'user_one':user_one, #### used for navbar, access to user1
...@@ -224,7 +224,8 @@ def profile(request, pk): ...@@ -224,7 +224,8 @@ def profile(request, pk):
current_user = BoodleUser.objects.get(pk=pk) current_user = BoodleUser.objects.get(pk=pk)
#auction bid user id = 3 --> bids user made --> know auctions g #auction bid user id = 3 --> bids user made --> know auctions g
bidsByUser = AuctionBid.objects.filter(boodleuserid=3).distinct('auctionid') ## ⭐ the user that is logged in
bidsByUser = AuctionBid.objects.filter(boodleuserid=1).distinct('auctionid')
auctionsOfUser = Auction.objects.all().distinct('auctionid') auctionsOfUser = Auction.objects.all().distinct('auctionid')
# for auction in auctionsOfUser: # for auction in auctionsOfUser:
......
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