Git Product home page Git Product logo

ku-polls's Introduction

ku-polls's People

Contributors

nuttapol-kor avatar

Watchers

 avatar

ku-polls's Issues

Add two methods in the Question class

  • is_published returns true if the current date is on or after the question’s publication date.
  • can_vote returns true if voting is currently allowed for this question.

Part2

  • Database setup
  • Creating models
  • Activating models
  • Playing with the API
  • Introducing the Django Admin

Show the previous voted

  • add @login_required at vote_for_poll() in polls/views.py
  • if has the previous voted show the previous voted as a string, if not has shown nothing.

Starting the project

  • Creating a project
  • The development server
  • Creating the Polls app
  • Write the first view

Improve navigation

  • On the polls index page, add “vote” and “results” links for each question.
  • Only show “vote” link for a poll where voting is allowed.
  • On the polls detail page, add a “Back to List of Polls” link so person can go back without voting.
  • On the voting results page, also add a “Back to List of Polls” link.

Part5

  • Writing the first test
  • Test a view

Show error for invalid navigation

If someone navigates to the polls detail page for a poll where voting is not allowed, redirect them to the polls index page and show an error message.

  • Use Django Messages Framework for this task

Part6

  • Customize Styling
  • Adding a background-image

Part7

  • Customize the admin form
  • Adding related objects
  • Customize the admin change list
  • Customize the admin look

Login-Logout System

  • Use Authentication in Django
  • Add URL for login, logout in mysite/urls.py
  • Add login.html
  • Redirect to home page when the user has been logout
  • Edit polls/index.html to show username when the user is authenticated.

Part4

  • Write a minimal form
  • Use generic views: Less code is better

Add the logging system

  • add logging logged in
  • add logging logged out
  • add logging login failed
  • add logging vote success

Add end-date for voting

  • add an end_date attribute that is the ending date for voting.
  • run migrations to update the database schema.

Inconsistent use of terms in requirements

4. Users have the number of survey items and the number of responses unrestricted.

As Mr James has posted in the classroom this morning, use "poll" instead of "survey" for now.

Saying the number of responses is unrestricted might make some misunderstand that one "user" can vote more than once, which shouldn't be the case. Perhaps adding a clause like "but they are limited to one vote for each poll" for clarity would be good.

1. Users can view a list of the available polls.

7. Web visitors cannot see the question before the opening date.

If "the question" and "polls" refer to the same thing, using the same term again would make it more clear.

3. Users can view and edit previously submitted polls before the end date.

Writing it this way would make it seem like the poll, that is the question and the choices, are editable until the "end date". If by this you actually meant the choice voted for can be changed, using these words instead would make it clearer.

Part3

  • Writing more views
  • Write views that actually do something
  • Raising a 404 error
  • Use the template system
  • Removing hardcoded URLs in templates
  • Namespacing URL names

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.