File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change 11from datetime import datetime
2+ from decimal import Decimal as D
23from typing import Optional
34
45from django .utils .timezone import now
@@ -32,11 +33,16 @@ class ObjectsView(UnicornView):
3233 dictionary = {"name" : "dictionary" , "nested" : {"name" : "nested dictionary" }}
3334 book = Book (title = "The Sandman" )
3435 books = Book .objects .all ()
35-
3636 date_example = now ()
37+ float_example : float = 1.1
38+ decimal_example = D ("1.1" )
39+ int_example = 4
3740
3841 def get_date (self ):
3942 self .date_example = now ()
4043
4144 def set_dictionary (self , val ):
4245 self .dictionary = val
46+
47+ def add_one_to_float (self ):
48+ self .float_example += 1
Original file line number Diff line number Diff line change 8383 </ ul >
8484 </ div >
8585
86+ < div >
87+ < input u:model ="float_example " type ="text " id ="floatExampleId ">
88+ < br />
89+ < input u:model ="decimal_example " type ="text " id ="decimalExampleId ">
90+ < br />
91+ < input u:model ="int_example " type ="text " id ="intExampleId ">
92+ < br />
93+
94+ < button type ="submit " u:click ="add_one_to_float "> Add 1 to float</ button >
95+ < br />
96+ float_example: {{ float_example }}
97+ < br />
98+ </ div >
99+
86100 < button u:click ="$reset "> $reset</ button >
87101 < button u:click ="$refresh "> $refresh</ button >
88102</ div >
You can’t perform that action at this time.
0 commit comments