refactor: set default values for core models

This commit is contained in:
Éloi Rivard 2024-04-07 16:51:55 +02:00
parent b6c59b3eda
commit c0a28c1480
No known key found for this signature in database
GPG key ID: 7EDA204EA57DD184

View file

@ -14,7 +14,7 @@ class Model:
It details all the common attributes shared by every models.
"""
id: Optional[str]
id: Optional[str] = None
"""A unique identifier for a SCIM resource as defined by the service
provider. Id will be :py:data:`None` until the
:meth:`~canaille.backends.models.BackendModel.save` method is called.
@ -32,11 +32,11 @@ class Model:
Section 9 for additional considerations regarding privacy.
"""
created: Optional[datetime.datetime]
created: Optional[datetime.datetime] = None
"""The :class:`~datetime.datetime` that the resource was added to the
service provider."""
last_modified: Optional[datetime.datetime]
last_modified: Optional[datetime.datetime] = None
"""The most recent :class:`~datetime.datetime` that the details of this
resource were updated at the service provider.