tortoise / tortoise/tortoise-orm
Support For Pydantic's advanced exclude and include
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 5.6k
- Forks
- 516
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 9
Description
Is your feature request related to a problem? Please describe.
When dealing with many nested objects, some relations have to be excluded from a response due to performance issues. This is currently not possible with pydantic_model_creator(...). This has been possible with pydantic since 2019 as of: samuelcolvin/pydantic#648
Describe the solution you'd like
pydantic_model_creator(...) to accept a dict just like pydantic does natively.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the pydantic_model_creator entry point and inspect how include and exclude options are currently handled. Support a dict matching Pydantic's native nested include/exclude format, and verify that nested relations can be omitted from the generated response model.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100