Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Commit

Permalink
Merge pull request #178 from edx/edx/kdmccormick/course-listing-reimp…
Browse files Browse the repository at this point in the history
…-final

EDUCATOR-852: Add filtering, sorting, pagination to course_summaries/ and create course_totals/
  • Loading branch information
kdmccormick authored Aug 18, 2017
2 parents 859d376 + 7e5476c commit 14e3a01
Show file tree
Hide file tree
Showing 57 changed files with 2,154 additions and 865 deletions.
2 changes: 1 addition & 1 deletion analytics_data_api/constants/enrollment_modes.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
PROFESSIONAL_NO_ID = u'no-id-professional'
VERIFIED = u'verified'

ALL = [AUDIT, CREDIT, HONOR, PROFESSIONAL, PROFESSIONAL_NO_ID, VERIFIED]
ALL = frozenset([AUDIT, CREDIT, HONOR, PROFESSIONAL, PROFESSIONAL_NO_ID, VERIFIED])
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"problem_display_name": "Earth Science Question",
"question_text": "Enter your answer:"
},
"model": "v0.problemfirstlastresponseanswerdistribution",
"model": "v1.problemfirstlastresponseanswerdistribution",
"pk": 1
},
{
Expand All @@ -32,7 +32,7 @@
"problem_display_name": "Earth Science Question",
"question_text": "Enter your answer:"
},
"model": "v0.problemfirstlastresponseanswerdistribution",
"model": "v1.problemfirstlastresponseanswerdistribution",
"pk": 2
},
{
Expand All @@ -50,7 +50,7 @@
"problem_display_name": "Earth Science Question",
"question_text": "Enter your answer:"
},
"model": "v0.problemfirstlastresponseanswerdistribution",
"model": "v1.problemfirstlastresponseanswerdistribution",
"pk": 3
},
{
Expand All @@ -68,7 +68,7 @@
"problem_display_name": "Earth Science Question",
"question_text": "Enter your answer:"
},
"model": "v0.problemfirstlastresponseanswerdistribution",
"model": "v1.problemfirstlastresponseanswerdistribution",
"pk": 4
},
{
Expand All @@ -86,7 +86,7 @@
"problem_display_name": null,
"question_text": null
},
"model": "v0.problemfirstlastresponseanswerdistribution",
"model": "v1.problemfirstlastresponseanswerdistribution",
"pk": 5
},
{
Expand All @@ -104,7 +104,7 @@
"problem_display_name": null,
"question_text": null
},
"model": "v0.problemfirstlastresponseanswerdistribution",
"model": "v1.problemfirstlastresponseanswerdistribution",
"pk": 6
},
{
Expand All @@ -122,7 +122,7 @@
"problem_display_name": null,
"question_text": null
},
"model": "v0.problemfirstlastresponseanswerdistribution",
"model": "v1.problemfirstlastresponseanswerdistribution",
"pk": 7
},
{
Expand All @@ -140,7 +140,7 @@
"problem_display_name": "Example problem",
"question_text": "Enter an answer:"
},
"model": "v0.problemfirstlastresponseanswerdistribution",
"model": "v1.problemfirstlastresponseanswerdistribution",
"pk": 8
},
{
Expand All @@ -158,7 +158,7 @@
"problem_display_name": "Example problem",
"question_text": "Enter an answer:"
},
"model": "v0.problemfirstlastresponseanswerdistribution",
"model": "v1.problemfirstlastresponseanswerdistribution",
"pk": 9
},
{
Expand All @@ -176,7 +176,7 @@
"problem_display_name": "Example problem",
"question_text": "Enter an answer:"
},
"model": "v0.problemfirstlastresponseanswerdistribution",
"model": "v1.problemfirstlastresponseanswerdistribution",
"pk": 10
},
{
Expand All @@ -194,7 +194,7 @@
"problem_display_name": "Example problem",
"question_text": "Randomized answer"
},
"model": "v0.problemfirstlastresponseanswerdistribution",
"model": "v1.problemfirstlastresponseanswerdistribution",
"pk": 11
},
{
Expand All @@ -212,7 +212,7 @@
"problem_display_name": "Example problem",
"question_text": "Randomized answer"
},
"model": "v0.problemfirstlastresponseanswerdistribution",
"model": "v1.problemfirstlastresponseanswerdistribution",
"pk": 12
},

Expand All @@ -231,7 +231,7 @@
"problem_display_name": "Example problem",
"question_text": "Select from the choices below:"
},
"model": "v0.problemfirstlastresponseanswerdistribution",
"model": "v1.problemfirstlastresponseanswerdistribution",
"pk": 13
},
{
Expand All @@ -249,7 +249,7 @@
"problem_display_name": "Example problem",
"question_text": "Select from the choices below:"
},
"model": "v0.problemfirstlastresponseanswerdistribution",
"model": "v1.problemfirstlastresponseanswerdistribution",
"pk": 14
},
{
Expand All @@ -267,7 +267,7 @@
"problem_display_name": "Example problem",
"question_text": "Select from the choices below:"
},
"model": "v0.problemfirstlastresponseanswerdistribution",
"model": "v1.problemfirstlastresponseanswerdistribution",
"pk": 15
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from django.utils import timezone

from analytics_data_api.constants import engagement_events
from analytics_data_api.v0 import models
from analytics_data_api.v1 import models
from analyticsdataserver.clients import CourseBlocksApiClient

logging.basicConfig(level=logging.INFO)
Expand Down
2 changes: 1 addition & 1 deletion analytics_data_api/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from rest_framework.urlpatterns import format_suffix_patterns

urlpatterns = [
url(r'^v0/', include('analytics_data_api.v0.urls', 'v0')),
url(r'^v1/', include('analytics_data_api.v1.urls', 'v1')),
]

urlpatterns = format_suffix_patterns(urlpatterns)
24 changes: 23 additions & 1 deletion analytics_data_api/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from opaque_keys.edx.locator import CourseKey
from opaque_keys import InvalidKeyError

from analytics_data_api.v0.exceptions import (
from analytics_data_api.v1.exceptions import (
ReportFileNotFoundError,
CannotCreateReportDownloadLinkError
)
Expand Down Expand Up @@ -230,3 +230,25 @@ def get_expiration_date(seconds):
Determine when a given link will expire, based on a given lifetime
"""
return datetime.datetime.utcnow() + datetime.timedelta(seconds=seconds)


class classproperty(object):
"""
A decorator for declaring a class-level property.
Conceptually ike combining @classmethod and @property, however that
doesn't work in practice, so we have to define our own decorator here.
"""

def __init__(self, getter):
self.getter = getter

def __get__(self, instance, owner):
return self.getter(owner)


def join_dicts(*dicts):
joined = {}
for d in dicts:
joined.update(d)
return joined
1 change: 0 additions & 1 deletion analytics_data_api/v0/__init__.py

This file was deleted.

174 changes: 0 additions & 174 deletions analytics_data_api/v0/tests/views/test_course_summaries.py

This file was deleted.

Loading

0 comments on commit 14e3a01

Please sign in to comment.