-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add data attributes definition for learning subdomain
- Loading branch information
1 parent
7ca8286
commit b5882fa
Showing
7 changed files
with
133 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
""" | ||
Data attributes for events within the architecture subdomain `learning`. | ||
These attributes follow the form of attr objects specified in OEP-49 data | ||
pattern. | ||
""" | ||
from datetime import datetime | ||
from typing import Dict | ||
|
||
import attr | ||
from opaque_keys.edx.keys import CourseKey | ||
|
||
|
||
@attr.s(frozen=True) | ||
class StudentData: | ||
""" | ||
Attributes defined for Open edX student object. | ||
""" | ||
|
||
username = attr.ib(type=str) | ||
email = attr.ib(type=str) | ||
is_active = attr.ib(type=bool, default=True) | ||
meta = attr.ib(type=Dict[str, str], factory=dict) | ||
name = attr.ib(type=str, factory=str) | ||
|
||
|
||
@attr.s(frozen=True) | ||
class RegistrationFormData: | ||
""" | ||
Attributes defined for Open edX student object. | ||
""" | ||
|
||
account_form = attr.ib(type=Dict[str, str], factory=dict) | ||
extension_form = attr.ib(type=Dict[str, str], factory=dict) | ||
|
||
|
||
@attr.s(frozen=True) | ||
class CourseData: | ||
""" | ||
Attributes defined for Open edX Course Overview object. | ||
""" | ||
|
||
course_key = attr.ib(type=CourseKey) | ||
display_name = attr.ib(type=str, factory=str) | ||
start = attr.ib(type=datetime, default=None) | ||
end = attr.ib(type=datetime, default=None) | ||
|
||
|
||
@attr.s(frozen=True) | ||
class CourseEnrollmentData: | ||
""" | ||
Attributes defined for Open edX Course Enrollment object. | ||
""" | ||
|
||
user = attr.ib(type=StudentData) | ||
course = attr.ib(type=CourseData) | ||
mode = attr.ib(type=str) | ||
is_active = attr.ib(type=bool) | ||
|
||
|
||
@attr.s(frozen=True) | ||
class CertificateData: | ||
""" | ||
Attributes defined for Open edX Certificate data object. | ||
""" | ||
|
||
user = attr.ib(type=StudentData) | ||
course = attr.ib(type=CourseData) | ||
mode = attr.ib(type=str) | ||
grade = attr.ib(type=str) | ||
status = attr.ib(type=str) | ||
download_url = attr.ib(type=str) | ||
name = attr.ib(type=str) | ||
|
||
|
||
@attr.s(frozen=True) | ||
class CohortData: | ||
""" | ||
Attributes defined for Open edX Cohort Membership object. | ||
""" | ||
|
||
user = attr.ib(type=StudentData) | ||
course = attr.ib(type=CourseData) | ||
name = attr.ib(type=str) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
# Core requirements for using this application | ||
-c constraints.txt | ||
|
||
attrs | ||
django | ||
edx-opaque-keys[django] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters