UserPublic
This class represents the public-facing schema for a user, extending the base user model to include unique identifiers and timestamps. It is primarily used for data serialization in API responses where sensitive information is excluded. The model ensures that every public user record includes a unique UUID and an optional creation date.
Attributes
| Attribute | Type | Description |
|---|---|---|
| id | uuid.UUID | Unique identifier for the user, represented as a UUID. |
| created_at | `datetime | None` = None |
Constructor
Signature
def UserPublic(
id: uuid.UUID,
created_at: datetime | None = None
) - > null
Parameters
| Name | Type | Description |
|---|---|---|
| id | uuid.UUID | The unique identifier for the user. |
| created_at | `datetime | None` = None |
Methods
id()
def id() - > uuid.UUID
The unique identifier for the user account.
Returns
| Type | Description |
|---|---|
uuid.UUID | A universally unique identifier (UUID) that serves as the primary key for the user. |
created_at()
def created_at() - > datetime | null
The timestamp indicating when the user record was first created.
Returns
| Type | Description |
|---|---|
| `datetime | null` |