Closed t-morisawa closed 4 years ago
hiddenパラメータで送るか、JSでいじいじするかの2択っぽい
https://stackoverflow.com/questions/1809494/post-unchecked-html-checkboxes/8972025 https://stackoverflow.com/questions/11424037/do-checkbox-inputs-only-post-data-if-theyre-checked
@atomic
デコレータをつけるだけでOK @atomic
async def update_all_from_checklist(self, checklist):
"""
Todolistのチェック状態を一括更新する
"""
todolist = await self.repository.get_all()
new = []
for index, item in enumerate(todolist.data):
if index in checklist.data:
checked = True
else:
checked = False
new.append(Todo(checked, item.task))
new_todolist = Todolist(new)
await self.repository.update_all(new_todolist)
どれも結構きついので、一旦見送り。 やるなら、idをhtmlに埋め込んでやっていく感じ。
スコープ
ユースケース
update_all_from_checklist
についてやること
アプリをいい感じにする方法を考える
メモ
アクション