Clean code pep8: Changed all camelCase in profile view and html to snake_case

parent 8bdf4784
...@@ -42,8 +42,8 @@ ...@@ -42,8 +42,8 @@
<!--Change auctions_now, auction to like favorites, favorite--> <!--Change auctions_now, auction to like favorites, favorite-->
<h2> Items {{displayname}} bid on </h2> <h2> Items {{displayname}} bid on </h2>
<div class="event-container"> <div class="event-container">
{% if auctionsOfUser %} {% if auctions_of_user %}
{% for id in idsOfAuction %} {% for id in ids_of_auction %}
<div class="event"> <div class="event">
<img src="http://via.placeholder.com/640x360" alt=""> <img src="http://via.placeholder.com/640x360" alt="">
<div class="event-text"> <div class="event-text">
......
...@@ -227,15 +227,15 @@ def profile(request, pk): ...@@ -227,15 +227,15 @@ 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
## ⭐ the user that is logged in ## ⭐ the user that is logged in
bidsByUser = AuctionBid.objects.filter(boodleuserid=3).distinct('auctionid') bids_by_user = AuctionBid.objects.filter(boodleuserid=3).distinct('auctionid')
auctionsOfUser = Auction.objects.all().distinct('auctionid') auctions_of_user = Auction.objects.all().distinct('auctionid')
idsOfAuction = [] ids_of_auction = []
for bid in bidsByUser: for bid in bids_by_user:
for auction in auctionsOfUser: for auction in auctions_of_user:
if bid.auctionid == auction: if bid.auctionid == auction:
idsOfAuction.append(bid.auctionid) ids_of_auction.append(bid.auctionid)
# print("These are the distinct auction IDs: ", idsOfAuction) # print("These are the distinct auction IDs: ", idsOfAuction)
...@@ -261,24 +261,15 @@ def profile(request, pk): ...@@ -261,24 +261,15 @@ def profile(request, pk):
return redirect('profileid', pk=pk) return redirect('profileid', pk=pk)
# 🔥 # 🔥
# checks if userid exists in store
# if current_user.userid in Store.objects.get():
# if current_user:
# current_store = Store.objects.filter(userid=pk)
# # current_store = Store.objects.get(pk=pk)
# # if the current store exists, it will be the pk the
# else:
# current_store.storeid = None # if current store doesnt exist (no user)
context = { context = {
'displayname': current_user.displayname, 'displayname': current_user.displayname,
'username': current_user.username, 'username': current_user.username,
'user': current_user.userid, 'user': current_user.userid,
'store': current_storeid, 'store': current_storeid,
'bidsByUser' : bidsByUser, 'bidsByUser' : bids_by_user,
'auctionsOfUser': auctionsOfUser, 'auctions_of_user': auctions_of_user,
'auctions': auctions, 'auctions': auctions,
'idsOfAuction': idsOfAuction, 'ids_of_auction': ids_of_auction,
'createStoreForm': form 'createStoreForm': form
} }
......
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