Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
bookshare
Commits
6d0c72c2
Commit
6d0c72c2
authored
Apr 07, 2015
by
Daniel W Bond
Browse files
improved filter to retrieve lookouts
parent
60a11fd0
Changes
2
Hide whitespace changes
Inline
Side-by-side
bookshare/core/views.py
View file @
6d0c72c2
...
...
@@ -55,12 +55,12 @@ class DetailStudent(LoginRequiredMixin, DetailView):
#context['listings'] = Listing.objects.filter(seller='2')
context
[
'listings'
]
=
student_listings
context
[
'me'
]
=
self
.
get_object
().
pk
context
[
'lookouts'
]
=
Lookout
.
objects
.
filter
(
owner
=
self
.
get_object
()
.
user
)
context
[
'lookouts'
]
=
Lookout
.
objects
.
filter
(
owner
=
self
.
get_object
())
context
[
'proceeds'
]
=
total_proceeds
(
student_listings
)
context
[
'sales'
]
=
total_sales
(
student_listings
)
context
[
'bids'
]
=
Bid
.
objects
.
filter
(
bidder
=
self
.
get_object
()
.
user
)
context
[
'bids'
]
=
Bid
.
objects
.
filter
(
bidder
=
self
.
get_object
())
return
context
...
...
bookshare/settings/views.py
View file @
6d0c72c2
...
...
@@ -8,5 +8,5 @@ class HomepageView(TemplateView):
def
get_context_data
(
self
,
**
kwargs
):
context
=
super
(
HomepageView
,
self
).
get_context_data
(
**
kwargs
)
if
self
.
request
.
user
.
is_authenticated
():
context
[
'lookouts'
]
=
Lookout
.
objects
.
filter
(
owner
=
self
.
request
.
user
)
context
[
'lookouts'
]
=
Lookout
.
objects
.
filter
(
owner
=
self
.
request
.
user
.
student
)
return
context
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