tortoise / tortoise/tortoise-orm

Support For Pydantic's advanced exclude and include

Open
#1,157 0 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.