File tree 2 files changed +16
-2
lines changed
2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 1
1
from __future__ import annotations
2
2
3
- from typing import TYPE_CHECKING , Callable
3
+ from typing import TYPE_CHECKING
4
4
5
5
from reactpy .core .events import EventHandler , to_event_handler_function
6
6
@@ -70,7 +70,7 @@ def ensure_input_elements_are_controlled(vdom_tree: VdomDict) -> VdomDict:
70
70
return vdom_tree
71
71
72
72
vdom_tree .setdefault ("eventHandlers" , {})
73
- if vdom_tree ["tagName" ] in { "input" } and "onChange" not in vdom_tree ["eventHandlers" ]:
73
+ if vdom_tree ["tagName" ] == "input" and "onChange" not in vdom_tree ["eventHandlers" ]:
74
74
vdom_tree ["eventHandlers" ]["onChange" ] = EventHandler (to_event_handler_function (_do_nothing_event ))
75
75
76
76
if "children" in vdom_tree :
Original file line number Diff line number Diff line change 1
1
from django import forms
2
+ from django .forms import ModelForm
3
+
4
+ from .. import models
2
5
3
6
4
7
class BasicForm (forms .Form ):
@@ -43,3 +46,14 @@ class BasicForm(forms.Form):
43
46
label = "model multiple choice field" , initial = "1" , queryset = models .TodoItem .objects .all ()
44
47
)
45
48
49
+ # Currently unsupported fields
50
+ # multi_value_field = MultiValueField(label="multi value", initial="[email protected] ")
51
+ # split_datetime_field = forms.SplitDateTimeField(label="split datetime")
52
+ # file_field = forms.FileField(label="file")
53
+ # image_field = forms.ImageField(label="image")
54
+
55
+
56
+ class DatabaseBackedForm (ModelForm ):
57
+ class Meta :
58
+ model = models .TodoItem
59
+ fields = "__all__"
You can’t perform that action at this time.
0 commit comments