tortoise-orm
tortoise-orm copied to clipboard
Fix one of the models TODOs
Description
- fixes one TODO mark in tortoise/models.py about Model._init_from_db
- Refactor the logic of execute_select function in executor who using several
_init_from_db
- Refactor generate logic of
db_native_fields/db_default_fields/db_complex_fields
, they were used in_init_from_db
- Use inited_keys set to avoid set attr twice
- Add
key not in meta.fields_map
check, this may fix the #1665
- Refactor the logic of execute_select function in executor who using several
- fixes mypy complaints for tortoise/queryset.py after remove all the
type: ignore
in it
Motivation and Context
fix TODO and improve type hint
How Has This Been Tested?
make ci
Checklist:
- [x] My code follows the code style of this project.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [ ] I have added the changelog accordingly.
- [x] I have read the CONTRIBUTING document.
- [ ] I have added tests to cover my changes.
- [x] All new and existing tests passed.