tortoise / tortoise/tortoise-orm
What is the best approach for creating pydantic response models?
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 5.6k
- Forks
- 516
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 9
Description
Currently, I am struggling with many problems in creating pydantic response models, because my database has grown a bit and I have a lot of m2m relations, foreign keys, etc. The nested PydanticMeta class becomes more and more a problem for me than a use, manual creation of model responses does not always work, because the m2m field mapping does not work for me as I mentioned in: #887
My question is, do any of you have a proven method / approach in creating pydantic response models?
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 by reading issue #887 and the existing guidance around nested PydanticMeta classes and manual response-model mapping. A useful outcome would need to define and document a proven approach for response models involving many-to-many relations and foreign keys.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- databases
- Issue type
- Documentation
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 15/100