Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Boodle
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Martina Therese R. Reyes
Boodle
Commits
b601d081
Commit
b601d081
authored
May 01, 2022
by
Martina Therese R. Reyes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean code pep8: Changed all camelCase in profile view and html to snake_case
parent
8bdf4784
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
20 deletions
+11
-20
profile.html
boodlesite/templates/profile.html
+2
-2
views.py
main/views.py
+9
-18
No files found.
boodlesite/templates/profile.html
View file @
b601d081
...
@@ -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 auctions
OfU
ser %}
{% if auctions
_of_u
ser %}
{% for id in ids
OfA
uction %}
{% for id in ids
_of_a
uction %}
<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"
>
...
...
main/views.py
View file @
b601d081
...
@@ -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
bids
ByU
ser
=
AuctionBid
.
objects
.
filter
(
boodleuserid
=
3
)
.
distinct
(
'auctionid'
)
bids
_by_u
ser
=
AuctionBid
.
objects
.
filter
(
boodleuserid
=
3
)
.
distinct
(
'auctionid'
)
auctions
OfU
ser
=
Auction
.
objects
.
all
()
.
distinct
(
'auctionid'
)
auctions
_of_u
ser
=
Auction
.
objects
.
all
()
.
distinct
(
'auctionid'
)
ids
OfA
uction
=
[]
ids
_of_a
uction
=
[]
for
bid
in
bids
ByU
ser
:
for
bid
in
bids
_by_u
ser
:
for
auction
in
auctions
OfU
ser
:
for
auction
in
auctions
_of_u
ser
:
if
bid
.
auctionid
==
auction
:
if
bid
.
auctionid
==
auction
:
ids
OfA
uction
.
append
(
bid
.
auctionid
)
ids
_of_a
uction
.
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'
:
bids
ByU
ser
,
'bidsByUser'
:
bids
_by_u
ser
,
'auctions
OfUser'
:
auctionsOfU
ser
,
'auctions
_of_user'
:
auctions_of_u
ser
,
'auctions'
:
auctions
,
'auctions'
:
auctions
,
'ids
OfAuction'
:
idsOfA
uction
,
'ids
_of_auction'
:
ids_of_a
uction
,
'createStoreForm'
:
form
'createStoreForm'
:
form
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment