Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix models to support pydantic orm_mode #43

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions {{cookiecutter.project_slug}}/backend/app/app/models/item.py
Expand Up @@ -6,6 +6,9 @@ class ItemBase(BaseModel):
title: str = None
description: str = None

class Config:
orm_mode = True


# Properties to receive on item creation
class ItemCreate(ItemBase):
Expand Down
2 changes: 2 additions & 0 deletions {{cookiecutter.project_slug}}/backend/app/app/models/user.py
Expand Up @@ -10,6 +10,8 @@ class UserBase(BaseModel):
is_superuser: Optional[bool] = False
full_name: Optional[str] = None

class Config:
orm_mode = True

class UserBaseInDB(UserBase):
id: int = None
Expand Down