Session editor and live sessions!
This commit is contained in:
@@ -7,11 +7,12 @@ from folkugat_web.model import temes as model
|
||||
|
||||
|
||||
def create_tema(title: str = "") -> model.Tema:
|
||||
return temes_w.insert_tema(tema=model.Tema(title=title))
|
||||
new_tema = model.Tema(title=title, hidden=False).with_ngrams()
|
||||
return temes_w.insert_tema(tema=new_tema)
|
||||
|
||||
|
||||
def delete_tema(tema_id: int) -> None:
|
||||
tema = temes_w.delete_tema(tema_id=tema_id)
|
||||
temes_w.delete_tema(tema_id=tema_id)
|
||||
|
||||
|
||||
def update_title(tema_id: int, title: str) -> model.Tema:
|
||||
@@ -20,9 +21,7 @@ def update_title(tema_id: int, title: str) -> model.Tema:
|
||||
if tema is None:
|
||||
raise ValueError(f"No tune found with tema_id = {tema_id}!")
|
||||
|
||||
new_tema = dataclasses.replace(tema, title=title)
|
||||
new_tema.compute_ngrams()
|
||||
|
||||
new_tema = dataclasses.replace(tema, title=title).with_ngrams()
|
||||
temes_w.update_tema(tema=new_tema, con=con)
|
||||
|
||||
return new_tema
|
||||
|
||||
Reference in New Issue
Block a user