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
0a653089
Commit
0a653089
authored
May 02, 2015
by
Daniel W Bond
Browse files
fixed queryset
parent
ddb55224
Changes
1
Hide whitespace changes
Inline
Side-by-side
bookshare/core/views.py
View file @
0a653089
...
...
@@ -27,7 +27,7 @@ class DetailStudent(LoginRequiredMixin, DetailView):
total_proceeds
=
Bid
.
objects
.
filter
(
listing__poster__user
=
self
.
get_object
()).
filter
(
listing__exchanged
=
True
).
aggregate
(
Sum
(
'price'
))[
'price__sum'
]
student_ratings
=
Rating
.
objects
.
filter
(
listing__poster
__user
=
self
.
get_object
())
student_ratings
=
Rating
.
objects
.
filter
(
listing__poster
=
self
.
get_object
())
if
student_ratings
:
student_stars
=
[
int
(
rating
.
stars
)
for
rating
in
student_ratings
]
print
student_stars
...
...
@@ -87,7 +87,7 @@ class StudentRatings(LoginRequiredMixin, DetailView):
def
get_context_data
(
self
,
**
kwargs
):
context
=
super
(
StudentRatings
,
self
).
get_context_data
(
**
kwargs
)
student_ratings
=
Rating
.
objects
.
filter
(
listing__poster
__user
=
self
.
get_object
())
student_ratings
=
Rating
.
objects
.
filter
(
listing__poster
=
self
.
get_object
())
# copied code!
if
student_ratings
:
...
...
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