Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add created_at and updated_at fields to Quiz model; update queryset o… #151

Merged
merged 1 commit into from
Feb 26, 2025

Conversation

yunho7687
Copy link
Member

@yunho7687 yunho7687 commented Feb 26, 2025

Change Summary

add new fields to the Quiz model and create a migration file
update querysets in various viewsets to order by the new created_at field.

Changes to Quiz model:

  • Added created_at and updated_at fields to the Quiz model in server/api/quiz/models.py to track the creation and update timestamps.

Database migration:

  • Created a migration file 0011_quiz_created_at_quiz_updated_at.py to add the created_at and updated_at fields to the Quiz model in the database.

Updates to viewsets:

  • Updated AdminQuizViewSet in server/api/quiz/views.py to order quizzes by created_at in descending order.
  • Updated QuizViewSet in server/api/quiz/views.py to order quizzes by created_at in descending order for quizzes with status 0 and visible.
  • Updated CompetitionQuizViewSet in server/api/quiz/views.py to order quizzes by created_at in descending order for quizzes with status 1 and visible.

Related issue

@yunho7687 yunho7687 requested a review from loklokyx February 26, 2025 04:44
Copy link
Contributor

@loklokyx loklokyx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me thanks

@yunho7687 yunho7687 merged commit 09e9fe0 into main Feb 26, 2025
6 checks passed
@yunho7687 yunho7687 deleted the issue-145-Bug_Competition_Get_Data branch February 26, 2025 04:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug Competition Get Data
2 participants