home
·
contact
·
privacy
projects
/
plomtask
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Refactor BaseModel sorting from GET handlers into class definitions.
[plomtask]
/
plomtask
/
processes.py
diff --git
a/plomtask/processes.py
b/plomtask/processes.py
index 36158996595dccfad678730eb29a50c422c26b9d..bb1de3a4a3356415473bc652d650e202886eb01b 100644
(file)
--- a/
plomtask/processes.py
+++ b/
plomtask/processes.py
@@
-36,6
+36,10
@@
class Process(BaseModel[int], ConditionsRelations):
add_to_dict = ['explicit_steps']
to_search = ['title.newest', 'description.newest']
can_create_by_id = True
add_to_dict = ['explicit_steps']
to_search = ['title.newest', 'description.newest']
can_create_by_id = True
+ sorters = {'steps': lambda p: len(p.explicit_steps),
+ 'owners': lambda p: p.n_owners,
+ 'effort': lambda p: p.effort.newest,
+ 'title': lambda p: p.title.newest}
def __init__(self, id_: int | None, calendarize: bool = False) -> None:
BaseModel.__init__(self, id_)
def __init__(self, id_: int | None, calendarize: bool = False) -> None:
BaseModel.__init__(self, id_)