Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
85fb7b8a
Commit
85fb7b8a
authored
8 years ago
by
Sanford Student
Browse files
Options
Downloads
Patches
Plain Diff
add index for modified to course and subsection grades
parent
28e3b1cb
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lms/djangoapps/grades/models.py
+11
-0
11 additions, 0 deletions
lms/djangoapps/grades/models.py
with
11 additions
and
0 deletions
lms/djangoapps/grades/models.py
+
11
−
0
View file @
85fb7b8a
...
...
@@ -253,6 +253,14 @@ class PersistentSubsectionGrade(DeleteGradesMixin, TimeStampedModel):
# * Course staff can see all grades for a course using (course_id,)
(
'
course_id
'
,
'
user_id
'
,
'
usage_key
'
),
]
# Allows querying in the following ways:
# (modified): find all the grades updated within a certain timespan
# (modified, course_id): find all the grades updated within a timespan for a certain course
# (modified, course_id, usage_key): find all the grades updated within a timespan for a subsection
# in a course
index_together
=
[
(
'
modified
'
,
'
course_id
'
,
'
usage_key
'
)
]
# primary key will need to be large for this table
id
=
UnsignedBigIntAutoField
(
primary_key
=
True
)
# pylint: disable=invalid-name
...
...
@@ -502,11 +510,14 @@ class PersistentCourseGrade(DeleteGradesMixin, TimeStampedModel):
# (course_id) for instructors to see all course grades, implicitly created via the unique_together constraint
# (user_id) for course dashboard; explicitly declared as an index below
# (passed_timestamp, course_id) for tracking when users first earned a passing grade.
# (modified): find all the grades updated within a certain timespan
# (modified, course_id): find all the grades updated within a certain timespan for a course
unique_together
=
[
(
'
course_id
'
,
'
user_id
'
),
]
index_together
=
[
(
'
passed_timestamp
'
,
'
course_id
'
),
(
'
modified
'
,
'
course_id
'
)
]
# primary key will need to be large for this table
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment