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
{
'id': int, # The id of this user.
'name': str, # The full name of this user.
'email': str, # The email of this user.
'username': str, # The username of this user.
}
:returns: An object as described above.
"""
return {
'id': self.id,
'name': self.name,
'email': self.email,
'username': self.username,
}
评论列表
文章目录