Skip to content

Commit

Permalink
Merge pull request #1 from PondererOfEnigmas/feature/add-pydantic-ser…
Browse files Browse the repository at this point in the history
…ialization

feat: add Pydantic BaseModel serialization support
  • Loading branch information
lfnovo authored Jan 17, 2025
2 parents 9c724bf + d2b6fd1 commit 078e39b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/surrantic/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ def _prepare_value(value: Any) -> str:
return f"'{value.isoformat()}'"
if isinstance(value, RecordID):
return str(value)
if isinstance(value, BaseModel):
return json.dumps(value.model_dump())
return json.dumps(value)

def _prepare_data(obj: Any) -> str:
Expand Down

0 comments on commit 078e39b

Please sign in to comment.