File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -47,10 +47,9 @@ def test_it_handles_inertia_meta_fields(self):
47
47
"created_at" : "2022-10-31T10:13:01" ,
48
48
}
49
49
),
50
- self .encode (sport )
50
+ self .encode (sport ),
51
51
)
52
52
53
-
54
53
def test_it_handles_querysets (self ):
55
54
User (
56
55
name = "Brandon" ,
Original file line number Diff line number Diff line change @@ -8,10 +8,11 @@ class User(models.Model):
8
8
registered_at = models .DateTimeField ()
9
9
created_at = models .DateField (auto_now_add = True )
10
10
11
+
11
12
class Sport (models .Model ):
12
13
name = models .CharField (max_length = 255 )
13
14
season = models .CharField (max_length = 255 )
14
15
created_at = models .DateField (auto_now_add = True )
15
16
16
17
class InertiaMeta :
17
- fields = ('id' , ' name' , ' created_at' )
18
+ fields = ("id" , " name" , " created_at" )
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ def model_to_dict(model):
14
14
15
15
class InertiaJsonEncoder (DjangoJSONEncoder ):
16
16
def default (self , value ):
17
- if hasattr (value .__class__ , ' InertiaMeta' ):
17
+ if hasattr (value .__class__ , " InertiaMeta" ):
18
18
return {
19
19
field : getattr (value , field )
20
20
for field in value .__class__ .InertiaMeta .fields
You can’t perform that action at this time.
0 commit comments