Skip to main content

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

AttributeTypeDescription
iduuid.UUIDUnique identifier for the user, represented as a UUID.
created_at`datetimeNone` = None

Constructor

Signature

def UserPublic(
id: uuid.UUID,
created_at: datetime | None = None
) - > null

Parameters

NameTypeDescription
iduuid.UUIDThe unique identifier for the user.
created_at`datetimeNone` = None

Methods


id()

def id() - > uuid.UUID

The unique identifier for the user account.

Returns

TypeDescription
uuid.UUIDA 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

TypeDescription
`datetimenull`