Skip to content

Iteration 2 Plan

fatalaijon edited this page Nov 6, 2020 · 1 revision

Iteration 2 Plan

Goals

  1. A poll has both a publication date and an end date. The end date is the last date when voting is permitted.
  2. The polls UI has better navigation and both polls details and polls result pages have better formatting.

Features

  1. The Question class has an end date that is the last date when voting is allowed.
  2. 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
  3. 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.

Tasks

  1. Add end_date attribute to Question and unit tests for it.
  2. Add is_published and can_vote methods with the meaning described above, and unit tests for them.
  3. 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.
  4. Improve appearance of results page. Make the votes align in a column, omit the word "votes" after the count -- it's redundant.
  5. Index page - show all published questions, not just 5 most recent.
    • Sort them by date published so newest questions are first
  6. Redirect the base url (/) to the polls index, so visitor doesn't get a '404 Not Found' error.
  7. Externalize configuration: remove SECRET_KEY and DEBUG from settings.py
    • Put them an a local .env file

Evaluation Criteria

  1. Navigating to / shows the polls index page.
  2. Polls index page shows all available questions, not just newest 5.
  3. Can vote on a poll only during voting period defined by the 2 date attributes.
  4. Polls details and polls results pages have a "Back to List of Polls" link.
Clone this wiki locally