Fakultas Ilmu Komputer UI
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
PMPL
Collection of Practice
2019
1606876052-practice
Commits
8c4f705f
Commit
8c4f705f
authored
Sep 25, 2019
by
Rayza Arasj Mahardhika
Browse files
refactor implementation to use constants
parent
cdd9652f
Pipeline
#21065
failed with stage
in 3 minutes and 7 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
lists/views.py
View file @
8c4f705f
...
...
@@ -3,13 +3,17 @@ from django.shortcuts import redirect, render
from
lists.models
import
Item
COMMENTARY_ZERO
=
'yey, waktunya berlibur'
COMMENTARY_LESS_THAN_FIVE
=
'sibuk tapi santai'
COMMENTARY_MORE_THAN_EQUAL_FIVE
=
'oh tidak'
def
get_commentary
(
item_count
):
if
(
item_count
==
0
):
return
'yey, waktunya berlibur'
return
COMMENTARY_ZERO
elif
(
item_count
<
5
):
return
'sibuk tapi santai'
return
COMMENTARY_LESS_THAN_FIVE
elif
(
item_count
>=
5
):
return
'oh tidak'
return
COMMENTARY_MORE_THAN_EQUAL_FIVE
def
home_page
(
request
):
if
request
.
method
==
'POST'
:
...
...
Write
Preview
Supports
Markdown
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