File tree 2 files changed +14
-11
lines changed 2 files changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -9,14 +9,3 @@ def on_click(self, evt=None):
9
9
10
10
class PyList (PyListTemplate ):
11
11
item_class = PyItem
12
-
13
- def add_task (* ags , ** kws ):
14
- # create a new dictionary representing the new task
15
- task = { "content" : new_task_content .value , "done" : False , "created_at" : dt .now () }
16
-
17
- # add a new task to the list and tell it to use the `content` key to show in the UI
18
- # and to use the key `done` to sync the task status with a checkbox element in the UI
19
- myList .add (task , labels = ['content' ], state_key = "done" )
20
-
21
- # clear the inputbox element used to create the new task
22
- new_task_content .clear ()
Original file line number Diff line number Diff line change 14
14
- /utils.py
15
15
</ py-env >
16
16
< py-register-widget src ="/pylist.py " name ="py-list " klass ="PyList "> </ py-register-widget >
17
+
18
+ < py-script >
19
+ def add_task(*ags, **kws):
20
+ # create a new dictionary representing the new task
21
+ task = { "content": new_task_content.value, "done": False, "created_at": dt.now() }
22
+
23
+ # add a new task to the list and tell it to use the `content` key to show in the UI
24
+ # and to use the key `done` to sync the task status with a checkbox element in the UI
25
+ myList.add(task, labels=['content'], state_key="done")
26
+
27
+ # clear the inputbox element used to create the new task
28
+ new_task_content.clear()
29
+
30
+ </ py-script >
17
31
</ head >
18
32
19
33
< body >
You can’t perform that action at this time.
0 commit comments