Add created_at and updated_at fields to Quiz model; update queryset o… #151
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Change Summary
add new fields to the
Quiz
model and create a migration fileupdate
querysets
in variousviewsets
to order by the newcreated_at
field.Changes to
Quiz
model:created_at
andupdated_at
fields to theQuiz
model inserver/api/quiz/models.py
to track the creation and update timestamps.Database migration:
0011_quiz_created_at_quiz_updated_at.py
to add thecreated_at
andupdated_at
fields to theQuiz
model in the database.Updates to viewsets:
AdminQuizViewSet
inserver/api/quiz/views.py
to order quizzes bycreated_at
in descending order.QuizViewSet
inserver/api/quiz/views.py
to order quizzes bycreated_at
in descending order for quizzes with status 0 and visible.CompetitionQuizViewSet
inserver/api/quiz/views.py
to order quizzes bycreated_at
in descending order for quizzes with status 1 and visible.Related issue