Entities
Understanding entities
from percolate.models.p8 import Task
p8.repository(Task).register()repo = p8.repository(Task)
task = Task(name='T1234',
description="A task for creating a youtube video explaining how percolate works",
project_name='percolate')
repo.update_records(task)class Task(Project):
"""Tasks are sub projects. A project can describe a larger objective and be broken down into tasks"""
id: typing.Optional[uuid.UUID| str] = Field(None,description= 'id generated for the name and project - these must be unique or they are overwritten')
project_name: typing.Optional[str] = Field(None, description="The related project name of relevant")
@model_validator(mode='before')
@classmethod
def _f(cls, values):
if not values.get('id'):
values['id'] = make_uuid({'name': values['name'], 'project_name': values['project_name']})
return values
@classmethod
def get_model_functions(cls):
"""fetch task external functions"""
return {'get_tasks_task_name_comments': 'get comments associated with this task, supplying the task name' }Indexing
Last updated