Skip to content

Commit

Permalink
Updating tutorial to match new codegen (#85)
Browse files Browse the repository at this point in the history
* Updating tutorial to match new codegen

* Adding support for better doc strings

* Updating examples to work with http and orm changes

* fixing type errors
  • Loading branch information
rmyers authored Nov 17, 2024
1 parent e41ee69 commit 3650ac6
Show file tree
Hide file tree
Showing 28 changed files with 1,046 additions and 746 deletions.
58 changes: 0 additions & 58 deletions cannula/contrib/orm.py

This file was deleted.

3 changes: 3 additions & 0 deletions cannula/datasource/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ def expected_fields(obj: typing.Any) -> set[str]:
if dataclasses.is_dataclass(obj):
return {field.name for field in dataclasses.fields(obj)}

if hasattr(obj, "model_fields"):
return {field for field in obj.model_fields}

raise ValueError(
"Invalid model for 'GraphModel' must be a dataclass or pydantic model"
)
Loading

0 comments on commit 3650ac6

Please sign in to comment.