Chauss-LLC / task_tree_local

App for managing your tasks in tree-like representation.
3 stars 2 forks source link

Core module API #11

Open Prikalel opened 2 years ago

Prikalel commented 2 years ago

API

Usage

t = Task("My plans") # Default status is STATUS.PENDING.
t.children += (Task("Lifeline plans"), )
new_t = Task("Make big things", parent=t)
new_t.parent = t.children[0]
KH9IZ commented 2 years ago

Also need to be valid next conditions:

Prikalel commented 2 years ago

Also need to be valid next conditions:

  • from tasktree.core import Task - Task class is present in init of core
  • subtask = task.find_child_by(tid=92) - find subtask by id

Function signature I will create a func with more simple signature for finding the child of the task by id, because this one, I'm sorry, is weird (I mean tid name in particular).

API Why Task.id is not string? For example, as I used in presentation?

KH9IZ commented 2 years ago

Why should it be string as in your presentation? As I know it's good practice to use int as id of objects. You can just increment id of previous object and here it is, new unique id.

KH9IZ commented 2 years ago

If you'll create a func with simple signature then let me know what is this signature. BTW, I agree that this is wired name of function)

Prikalel commented 2 years ago

Why should it be string as in your presentation? As I know it's good practice to use int as id of objects. You can just increment id of previous object and here it is, new unique id.

ok, agree with you. int is better. i should to refactor it to int type.

Prikalel commented 2 years ago

See https://github.com/Chauss-LLC/task_tree_local/pull/17 for new core implementation.