Skip to content

Commit

Permalink
docs: adapt readme and examples to model field grouping
Browse files Browse the repository at this point in the history
  • Loading branch information
lu-pl authored and kevinstadler committed Dec 3, 2024
1 parent 19bfb15 commit b962af6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ from pydantic import BaseModel, ConfigDict
from rdfproxy import Page, QueryParameters, SPARQLBinding, SPARQLModelAdapter

class Work(BaseModel):
model_config = ConfigDict(group_by="workName")
model_config = ConfigDict(group_by="name")

name: Annotated[str, SPARQLBinding("workName")]
viafs: Annotated[list[str], SPARQLBinding("viaf")]

class Author(BaseModel):
model_config = ConfigDict(group_by="authorName")
model_config = ConfigDict(group_by="surname")

gnd: str
surname: Annotated[str, SPARQLBinding("authorName")]
Expand Down
4 changes: 2 additions & 2 deletions examples/full_static_fastapi_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@


class Work(BaseModel):
model_config = ConfigDict(group_by="workName")
model_config = ConfigDict(group_by="name")

name: Annotated[str, SPARQLBinding("workName")]
viafs: Annotated[list[str], SPARQLBinding("viaf")]


class Author(BaseModel):
model_config = ConfigDict(group_by="authorName")
model_config = ConfigDict(group_by="surname")

gnd: str
surname: Annotated[str, SPARQLBinding("authorName")]
Expand Down

0 comments on commit b962af6

Please sign in to comment.