File tree Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -567,7 +567,11 @@ def get_config(name: str) -> Any:
567567 if isinstance (original_field , FieldInfo ):
568568 field = original_field
569569 else :
570- annotated_field = get_annotations (new_cls .__dict__ ).get (k , {})
570+ annotated_field = next (
571+ ann
572+ for c in new_cls .__mro__
573+ if (ann := get_annotations (c .__dict__ ).get (k ))
574+ )
571575 annotated_field_meta = getattr (
572576 annotated_field , "__metadata__" , (())
573577 )
Original file line number Diff line number Diff line change 44
55
66def test_declaration_syntax_1 ():
7- class Person1 (SQLModel , table = True ):
7+ class Person1 (SQLModel ):
88 name : str = Field (primary_key = True )
99
10+ class Person1Final (Person1 , table = True ):
11+ pass
12+
1013
1114def test_declaration_syntax_2 ():
12- class Person2 (SQLModel , table = True ):
15+ class Person2 (SQLModel ):
1316 name : Annotated [str , Field (primary_key = True )]
1417
18+ class Person2Final (Person2 , table = True ):
19+ pass
20+
1521
1622def test_declaration_syntax_3 ():
17- class Person3 (SQLModel , table = True ):
23+ class Person3 (SQLModel ):
1824 name : Annotated [str , ...] = Field (primary_key = True )
25+
26+ class Person3Final (Person3 , table = True ):
27+ pass
You can’t perform that action at this time.
0 commit comments