ToDoWrite Models
This section documents all the ToDoWrite Models - the core data models that form the 12-layer hierarchy.
Model Hierarchy
Goal
├── Concept
├── Context
├── Constraints
├── Requirements
├── AcceptanceCriteria
├── InterfaceContract
├── Phase
│ └── Step
│ └── Task
│ └── SubTask
└── Command
Label is a shared model for many-to-many relationships across all layers.
Core Models
Goal
- class Goal(**kwargs)[source]
Bases:
Base,TimestampMixinToDoWrite Goal model for hierarchical task management.
- id
- title
- description
- status
- progress
- started_on
- ended_on
- owner
- severity
- work_type
- assignee
- extra_data
- labels
- tasks
- phases
- constraints
- concepts
- contexts
- classmethod create(title, description='', owner='', severity='', work_type='', assignee='')[source]
Create a new Goal instance with default values.
- Return type:
- start_work()[source]
Mark goal as started by setting started_on to current timestamp.
- Return type:
- complete_work()[source]
Mark goal as completed by setting ended_on to current timestamp.
- Return type:
- classmethod find_active(session)[source]
Get all active (not completed) goals.
- get_work_duration()[source]
Get the duration between start and completion in ISO format.
- __init__(**kwargs)
A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
- created_at
- updated_at
Concept
- class Concept(**kwargs)[source]
Bases:
Base,TimestampMixinToDoWrite Concept model for hierarchical task management.
- id
- title
- description
- status
- progress
- started_on
- ended_on
- owner
- severity
- work_type
- assignee
- extra_data
- labels
- goals
- contexts
- requirements
- __init__(**kwargs)
A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
- created_at
- updated_at
Context
- class Context(**kwargs)[source]
Bases:
Base,TimestampMixinToDoWrite Context model for hierarchical task management.
- id
- title
- description
- status
- progress
- started_on
- ended_on
- owner
- severity
- work_type
- assignee
- extra_data
- labels
- concepts
- goals
- requirements
- __init__(**kwargs)
A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
- created_at
- updated_at
Constraints
Requirements
AcceptanceCriteria
- class AcceptanceCriteria(**kwargs)[source]
Bases:
Base,TimestampMixinToDoWrite AcceptanceCriteria model for hierarchical task management.
- id
- title
- description
- status
- progress
- started_on
- ended_on
- owner
- severity
- work_type
- assignee
- extra_data
- labels
- requirements
- interface_contracts
- __init__(**kwargs)
A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
- created_at
- updated_at
InterfaceContract
- class InterfaceContract(**kwargs)[source]
Bases:
Base,TimestampMixinToDoWrite InterfaceContract model for hierarchical task management.
- id
- title
- description
- status
- progress
- started_on
- ended_on
- owner
- severity
- work_type
- assignee
- extra_data
- labels
- acceptance_criteria
- phases
- __init__(**kwargs)
A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
- created_at
- updated_at
Phase
- class Phase(**kwargs)[source]
Bases:
Base,TimestampMixinToDoWrite Phase model for hierarchical task management.
- id
- title
- description
- status
- progress
- started_on
- ended_on
- owner
- severity
- work_type
- assignee
- extra_data
- labels
- goals
- steps
- interface_contracts
- __init__(**kwargs)
A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
- created_at
- updated_at
Step
- class Step(**kwargs)[source]
Bases:
Base,TimestampMixinToDoWrite Step model for hierarchical task management.
- id
- title
- description
- status
- progress
- started_on
- ended_on
- owner
- severity
- work_type
- assignee
- extra_data
- labels
- phases
- tasks
- __init__(**kwargs)
A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
- created_at
- updated_at
Task
- class Task(**kwargs)[source]
Bases:
Base,TimestampMixinToDoWrite Task model for hierarchical task management.
- id
- title
- description
- status
- progress
- started_on
- ended_on
- owner
- severity
- work_type
- assignee
- extra_data
- labels
- goals
- steps
- sub_tasks
- property commands
Get all commands from all subtasks for this task.
Provides complete execution plan visibility by aggregating all commands across all subtasks belonging to this task.
- Returns:
List of all Command objects from all subtasks in execution order.
- property total_commands_count
Get total number of commands across all subtasks.
- property completed_commands_count
Get count of completed commands across all subtasks.
- property execution_progress_percentage
Calculate execution progress as percentage based on completed commands.
- __init__(**kwargs)
A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
- created_at
- updated_at
SubTask
- class SubTask(**kwargs)[source]
Bases:
Base,TimestampMixinToDoWrite SubTask model for hierarchical task management.
- id
- title
- description
- status
- progress
- started_on
- ended_on
- owner
- severity
- work_type
- assignee
- extra_data
- labels
- tasks
- commands
- __init__(**kwargs)
A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
- created_at
- updated_at
Command
- class Command(**kwargs)[source]
Bases:
Base,TimestampMixinToDoWrite Command model for hierarchical task management.
- id
- title
- description
- status
- progress
- started_on
- ended_on
- owner
- severity
- work_type
- assignee
- acceptance_criteria_id
- cmd
- cmd_params
- runtime_env
- output
- artifacts
- labels
- sub_tasks
- property runtime_env_dict
Get runtime environment as dictionary.
- property artifacts_list
Get artifacts as list.
- __init__(**kwargs)
A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
- created_at
- updated_at
Label
- class Label(**kwargs)[source]
Bases:
Base,TimestampMixinToDoWrite Label model for categorizing and tagging other models.
- id
- name
- goals
- concepts
- contexts
- constraints
- requirements
- acceptance_criteria
- interface_contracts
- phases
- steps
- tasks
- sub_tasks
- commands
- __init__(**kwargs)
A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
- created_at
- updated_at
Schema Information
Total Tables: 33 (12 model tables + 21 association tables)
Primary Keys: Auto-incrementing integers (1, 2, 3, …)
Foreign Keys: Proper referential integrity
Database Support: SQLite and PostgreSQL
Schema Files: Available in
lib_package/src/todowrite/core/schemas/
For detailed SQL and JSON schemas, see Database Schema.