Commit Graph

11 Commits

Author SHA1 Message Date
sosokker
356e78a839 Editable pub_date + docstring / format file with black.py 2023-09-10 21:52:46 +07:00
sosokker
1b996629da Refine UI/UX - Add new Feature (Model) - Refine View
1. Refine UI/UX
Apply Tailwinds
Rewrite all page

2. Add new feature to model
Add new field
- description - long - short
- use default + editable instead of auto_add_now
- track up vote
- Change timezone
- Add time left track
-Add participant
-Add up/down vote attribute

-- Choice
- Add total_vote
-Add calculate_percentage of vote

3. Refine View
-Redirect instead of home page
-Add context to result, detail view
-Apply ChartJS
-Delete home
2023-09-09 21:20:23 +07:00
sosokker
c116a2ff0d Update Test and Model for Default pub_date Handling
In this commit, I change default field of pub_date into auto_add_now and it change the way pub_date assign work so I need to add several updates to address issues and errors in the code and tests related to the handling of the pub_date attribute in the Question model.

Test Updates
- Modified the create_question function in tests to accept pub_date when necessary and set it explicitly in the tests to match the new model definition.

Ensured the correct ordering of past questions in the index view.

Model Update
- Modified the Question model to use auto_now_add=True for pub_date to set it to the current date and time automatically.
2023-09-08 22:36:41 +07:00
sosokker
32605720fc Check vote score. Vote score can only be 0 or positive 2023-09-07 22:34:36 +07:00
sosokker
215be4d95c Modify test case and logic of can_vote in Question model 2023-09-05 21:55:41 +07:00
sosokker
e0c7995f28 Add is_published, can_vote to QuestionModel/ Add test for can_vote, is_published
is_published -> Check if the specific question able to be published
can_vote -> Can vote or not, check it from pub time

Delete some unnecessary files
2023-09-05 21:25:04 +07:00
sosokker
9f3aba25cd Add docstring to classes and methods and clean the code. 2023-08-28 23:04:08 +07:00
sosokker
48670592e4 Customize Admin Page view 2023-08-28 20:56:22 +07:00
sosokker
68385de61f Add Testing on models, views, detailed/ Fix bugs
Fix time bugs of was_published_recently()  in models
2023-08-28 20:01:39 +07:00
sosokker
df073ed6ce Create polls models and migrate 2023-08-28 18:57:49 +07:00
sosokker
be11909e59 Create the polls app. 2023-08-26 16:28:34 +07:00