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
615227a2
Commit
615227a2
authored
Feb 25, 2020
by
Daniel W Bond
Browse files
missing some of the py3 prints still, somehow
parent
a0fb4c4a
Changes
3
Hide whitespace changes
Inline
Side-by-side
bookshare/core/views.py
View file @
615227a2
...
...
@@ -32,7 +32,7 @@ class DetailStudent(LoginRequiredMixin, DetailView):
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
print
(
student_stars
)
average_stars
=
sum
(
student_stars
)
/
float
((
len
(
student_stars
)))
else
:
average_stars
=
None
...
...
@@ -100,7 +100,7 @@ class StudentRatings(LoginRequiredMixin, DetailView):
# copied code!
if
student_ratings
:
student_stars
=
[
int
(
rating
.
stars
)
for
rating
in
student_ratings
]
print
student_stars
print
(
student_stars
)
average_stars
=
sum
(
student_stars
)
/
float
((
len
(
student_stars
)))
else
:
average_stars
=
None
...
...
bookshare/trades/forms.py
View file @
615227a2
...
...
@@ -75,7 +75,7 @@ class ListingForm(forms.ModelForm):
def
clean
(
self
):
cleaned_data
=
super
(
ListingForm
,
self
).
clean
()
print
cleaned_data
print
(
cleaned_data
)
return
super
(
ListingForm
,
self
).
clean
()
...
...
bookshare/trades/views.py
View file @
615227a2
...
...
@@ -57,11 +57,11 @@ class CreateListing(LoginRequiredMixin, FormValidMessageMixin, CreateView):
user_image
=
Image
.
open
(
form
.
instance
.
photo
)
image_format
=
user_image
.
format
print
user_image
print
(
user_image
)
width
,
height
=
user_image
.
size
print
user_image
.
size
print
width
,
"width"
print
height
,
"height"
print
(
user_image
.
size
)
print
(
width
,
"width"
)
print
(
height
,
"height"
)
maxsize
=
(
2560
,
1920
)
# five megapixels is 2560x1920
if
(
width
>
2560
)
or
(
height
>
1920
):
...
...
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