JobLog
Background job execution log.
Records job execution status and results for monitoring,
debugging, and audit purposes.
Attributes:
job_id: Unique job identifier from job queue
job_name: Name of the job function
status: Current status (queued/running/success/failed)
enqueued_at: When the job was added to queue
started_at: When the job started executing
completed_at: When the job finished
error: Error message if job failed
result: Job result data if successful
Source: job_log.py
Fields
| Field | Type | Required | Description | Validators |
|---|---|---|---|---|
| job_id | str | ✓ | Unique job identifier from job queue | minLen: 1 |
| job_name | str | ✓ | Name of the job function | minLen: 1 |
| status | str | ✓ | Job status: queued, running, success, or failed | - |
| enqueued_at | datetime | When the job was added to queue | - | |
| started_at | datetime | None | When the job started executing | |
| completed_at | datetime | None | When the job finished (success or failure) | |
| error | str | None | Error message if job failed | |
| result | dict[str, Any] | None | Job result data if successful |
Permissions
| Role | Create | Delete | Read | Write |
|---|---|---|---|---|
| Admin | ✓ | ✓ | ✓ | ✓ |
| Employee | ✓ | |||
| Manager | ✓ |
Configuration
| Setting | Value |
|---|---|
| Submittable | False |
| Track Changes | True |
Controller
Controller hooks are implemented in *_controller.py files.
Available lifecycle hooks:
validate()- Called before save, raise exceptions for validation errorsbefore_insert()- Called before inserting a new documentafter_insert()- Called after successfully insertingbefore_save()- Called before saving (insert or update)after_save()- Called after savingbefore_delete()- Called before deletingafter_delete()- Called after deleting