Skip to content

Commit 902611f

Browse files
committed
fix base models
1 parent aa61197 commit 902611f

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

fastapi_users_db_dynamodb/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
class DynamoDBBaseUserTable(BaseModel, Generic[ID]):
4040
"""Base user table schema for DynamoDB."""
4141

42-
model_config = ConfigDict(arbitrary_types_allowed=True)
42+
model_config = ConfigDict(arbitrary_types_allowed=True, from_attributes=True)
4343

4444
__tablename__ = "user"
4545

fastapi_users_db_dynamodb/access_token.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
class DynamoDBBaseAccessTokenTable(BaseModel, Generic[ID]):
2727
"""Base access token table schema for DynamoDB."""
2828

29-
model_config = ConfigDict(arbitrary_types_allowed=True)
29+
model_config = ConfigDict(arbitrary_types_allowed=True, from_attributes=True)
3030

3131
__tablename__ = "accesstoken"
3232

tests/test_users.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@
1818

1919

2020
class Base(BaseModel):
21-
model_config = ConfigDict(arbitrary_types_allowed=True)
21+
model_config = ConfigDict(arbitrary_types_allowed=True, from_attributes=True)
2222

2323

2424
class User(DynamoDBBaseUserTableUUID, Base):
2525
first_name: str | None = Field(default=None, description="First name of the user")
2626

2727

28-
class OAuthBase:
29-
pass
28+
class OAuthBase(BaseModel):
29+
model_config = ConfigDict(arbitrary_types_allowed=True, from_attributes=True)
3030

3131

3232
class OAuthAccount(DynamoDBBaseOAuthAccountTableUUID, OAuthBase):

0 commit comments

Comments
 (0)