def __to_json__(self) -> t.Mapping[str, t.Any]:
"""Creates a JSON serializable representation of this object.
This object will look like this:
.. code:: python
{
'name': str, # The name of the course,
'id': int, # The id of this course.
'created_at': str, # ISO UTC date.
'is_lti': bool, # Is the this course a LTI course,
}
:returns: A object as described above.
"""
return {
'id': self.id,
'name': self.name,
'created_at': self.created_at.isoformat(),
'is_lti': self.lti_course_id is not None,
}
评论列表
文章目录