Skip to content
This repository was archived by the owner on Dec 31, 2023. It is now read-only.

Fix models to support pydantic orm_mode #2

Merged
merged 1 commit into from
Dec 6, 2019
Merged

Conversation

br3ndonland
Copy link
Owner

See GitHub PR 43
fastapi#43
See GitHub issue 72
fastapi#72

When viewing the user profile, name and email weren't showing up.

Docker Compose logs showed a pydantic error:
https://pydantic-docs.helpmanual.io/

backend_1        | pydantic.error_wrappers.ValidationError: 1 validation
                   error for User
backend_1        | response -> 0
backend_1        |   value is not a valid dict (type=type_error.dict)

Pydantic orm_mode is needed. This commit will update the database models
to use pydantic orm_mode, with cleaner syntax than the fix suggested in
issue fastapi#72 (by adding class Config directly to the base class).

See GitHub PR fastapi#43
fastapi#43
See GitHub issue fastapi#72
fastapi#72

When viewing the user profile, name and email weren't showing up.

Docker Compose logs showed a pydantic error:
https://pydantic-docs.helpmanual.io/

```
backend_1        | pydantic.error_wrappers.ValidationError: 1 validation
                   error for User
backend_1        | response -> 0
backend_1        |   value is not a valid dict (type=type_error.dict)
```

Pydantic orm_mode is needed. This commit will update the database models
to use pydantic orm_mode, with cleaner syntax than the fix suggested in
issue fastapi#72 (by adding class Config directly to the base class).
@br3ndonland br3ndonland merged commit f9254f6 into develop Dec 6, 2019
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant