-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* inspect from_orm
- Loading branch information
Showing
7 changed files
with
110 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
from pydantic import BaseModel | ||
|
||
|
||
class A(BaseModel): | ||
pass | ||
<error descr="You must have the config attribute orm_mode=True to use from_orm">A.from_orm('')</error> | ||
|
||
class B(BaseModel): | ||
class Config: | ||
orm_mode=False | ||
<error descr="You must have the config attribute orm_mode=True to use from_orm">B.from_orm('')</error> | ||
|
||
|
||
class C(BaseModel): | ||
class Config: | ||
orm_mode=True | ||
C.from_orm('') | ||
|
||
class C(BaseModel): | ||
class Config: | ||
orm_mode=False | ||
<error descr="You must have the config attribute orm_mode=True to use from_orm">C.from_orm('')</error> | ||
|
||
orm_mode = True | ||
class D(BaseModel): | ||
class Config: | ||
orm_mode=orm_mode | ||
D.from_orm('') | ||
|
||
|
||
class E(D): | ||
class Config: | ||
orm_mode=False | ||
<error descr="You must have the config attribute orm_mode=True to use from_orm">E.from_orm('')</error> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters