sosokker
f33dbdf1d5
Delete update pub_date field in admin
2023-09-09 00:54:54 +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
c54492c418
Add end_date customizer to admin panel
2023-09-07 22:43:54 +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
380201e020
Fix indent in test
2023-09-05 20:17:33 +07:00
sosokker
1f3840c0b8
Add publication to poll cards.
2023-08-28 23:11:33 +07:00
sosokker
9f3aba25cd
Add docstring to classes and methods and clean the code.
2023-08-28 23:04:08 +07:00
sosokker
477903dfd3
Update Views of all pages - index, detail, result / Add Home Page
...
Update views of all pages and add HomeView (Homepage) + Update data of sqlite3 polls database
2023-08-28 22:32:42 +07:00
sosokker
59ae9b68b3
Fix Missing results.html template file
2023-08-28 22:25:09 +07:00
sosokker
48670592e4
Customize Admin Page view
2023-08-28 20:56:22 +07:00
sosokker
d271325ab1
Style polls page
2023-08-28 20:51:27 +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
f7c2012118
Apply minimal form to detail page/ Use generic view on index-detail-result
2023-08-28 19:31:26 +07:00
sosokker
a62096f7e5
Create new views for polls/ Add detail views/ Use template
2023-08-28 19:24:49 +07:00
sosokker
0db4bad757
Explore Django admin/ Register Question to admin site
2023-08-28 19:03:04 +07:00
sosokker
df073ed6ce
Create polls models and migrate
2023-08-28 18:57:49 +07:00
sosokker
53f858ecde
Add first views to polls app
2023-08-26 16:39:10 +07:00
sosokker
be11909e59
Create the polls app.
2023-08-26 16:28:34 +07:00