Skip to content

Classes

Schedule


Schedule

Represents a schedule.

PARAMETER DESCRIPTION
_id

A unique identifier for the schedule.

TYPE: str

title

The title of the schedule.

TYPE: str

duration

The duration of the schedule.

TYPE: timedelta

created_at

The datetime when the schedule was created.

TYPE: datetime

description

A description of the schedule.

TYPE: Optional[str] DEFAULT: None

callback

A callback event name to be executed when the schedule ends.

TYPE: Optional[str] DEFAULT: None

is_active

is_active(current_time: datetime) -> bool

Check if the schedule is active.

PARAMETER DESCRIPTION
current_time

The current time to compare with ends_at.

TYPE: datetime

RETURNS DESCRIPTION
bool

True if the schedule is active, otherwise False.