-
Notifications
You must be signed in to change notification settings - Fork 0
Iteration 2 Plan
fatalaijon edited this page Nov 6, 2020
·
1 revision
- A poll has both a publication date and an end date. The end date is the last date when voting is permitted.
- The polls UI has better navigation and both polls details and polls result pages have better formatting.
- The Question class has an end date that is the last date when voting is allowed.
- Question class has methods to facilitate queries that the views need to make:
-
is_published
returns true if current date is on or after question's publication date -
can_vote
returns true if voting is currently allowed for this question
-
- If the user tries to access the question details page for a poll that is not yet published, redirect to the polls index page with an error message.
- Add
end_date
attribute to Question and unit tests for it. - Add
is_published
andcan_vote
methods with the meaning described above, and unit tests for them. - Change or add navigation links
- On polls index page, add "vote" and "results" links for each question.
- On voting page, add a "Back to Polls" link so person can go back without voting.
- On the voting results page, it doesn't make sense to vote again, so remove that link and instead pub a "Back to Polls" link.
- Improve appearance of results page. Make the votes align in a column, omit the word "votes" after the count -- it's redundant.
- Index page - show all published questions, not just 5 most recent.
- Sort them by date published so newest questions are first
- Redirect the base url (
/
) to the polls index, so visitor doesn't get a '404 Not Found' error. - Externalize configuration: remove SECRET_KEY and DEBUG from settings.py
- Put them an a local .env file
- Navigating to / shows the polls index page.
- Polls index page shows all available questions, not just newest 5.
- Can vote on a poll only during voting period defined by the 2 date attributes.
- Polls details and polls results pages have a "Back to List of Polls" link.