Skip to content

Commit

Permalink
docs: update docstrings of each Data class
Browse files Browse the repository at this point in the history
  • Loading branch information
mariajgrimaldi committed Jul 27, 2021
1 parent 41412d4 commit d3dcca8
Showing 1 changed file with 46 additions and 1 deletion.
47 changes: 46 additions & 1 deletion openedx_events/learning/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
class UserNonPersonalData:
"""
Attributes defined for Open edX user object based on non-PII data.
Arguments:
id (int): unique identifier for the Django User object.
is_active (bool): indicates whether the user is active.
"""

id = attr.ib(type=int)
Expand All @@ -24,6 +28,11 @@ class UserNonPersonalData:
class UserPersonalData:
"""
Attributes defined for Open edX user object based on PII data.
Arguments:
username (str): username associated with the Open edX user.
email (str): email associated with the Open edX user.
name (str): email associated with the Open edX user's profile.
"""

username = attr.ib(type=str)
Expand All @@ -35,6 +44,12 @@ class UserPersonalData:
class UserData:
"""
Attributes defined for Open edX user object.
Arguments:
user_non_pii (UserNonPersonalData): user's Personal Identifiable
Information.
user_pii (UserPersonalData): user's Non Personal Identifiable
Information.
"""

user_non_pii = attr.ib(type=UserNonPersonalData)
Expand All @@ -45,6 +60,12 @@ class UserData:
class CourseData:
"""
Attributes defined for Open edX Course Overview object.
Arguments:
course_key (str): identifier of the Course object.
display_name (str): display name associated with the course.
start (datetime): start date for the course.
end (datetime): end date for the course.
"""

course_key = attr.ib(type=CourseKey)
Expand All @@ -57,6 +78,14 @@ class CourseData:
class CourseEnrollmentData:
"""
Attributes defined for Open edX Course Enrollment object.
Arguments:
user (UserData): user associated with the Course Enrollment.
course (CourseData): course where the user is enrolled in.
mode (str): course mode associated with the course.
is_active (bool): whether the enrollment is active.
creation_date (datetime): creation date of the enrollment.
created_by (UserData): if available, who created the enrollment.
"""

user = attr.ib(type=UserData)
Expand All @@ -71,21 +100,37 @@ class CourseEnrollmentData:
class CertificateData:
"""
Attributes defined for Open edX Certificate data object.
Arguments:
user (UserData): user associated with the Certificate.
course (CourseData): course where the user obtained the certificate.
mode (str): course mode associated with the course.
grade (str): user's grade in this course run.
current_status (str): current certificate status.
previous_status (str): if available, pre-event certificate status.
download_url (str): URL where the PDF version of the certificate.
name (str): user's name.
"""

user = attr.ib(type=UserData)
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)
current_status = attr.ib(type=str)
previous_status = attr.ib(type=str, factory=str)


@attr.s(frozen=True)
class CohortData:
"""
Attributes defined for Open edX Cohort Membership object.
Arguments:
user (UserData): user assigned to the group.
course (CourseData): course associated with the course group.
name (str): name of the cohort group.
"""

user = attr.ib(type=UserData)
Expand Down

0 comments on commit d3dcca8

Please sign in to comment.