-
-
Notifications
You must be signed in to change notification settings - Fork 352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow passing modules to Tortoise.init_models() #561
Allow passing modules to Tortoise.init_models() #561
Conversation
9bce82b
to
d53f48c
Compare
Pull Request Test Coverage Report for Build 380879510
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks you! Looks good to me
Could you please add description to the top of changelog file?
743a2df
to
84bc839
Compare
@abondar I've updated the changelog and added myself to contributor list. |
@lqmanh released as 0.16.19 |
Hello, should the types have been updated for |
@bnaoki No I hadn't updated those functions. I'll create another PR when I have time. |
Description
Allow passing module objects to
models_paths
param ofTortoise.init_models()
.Motivation and Context
Now
Tortoise.init_models()
only acceptsmodels_paths
as a list of strings, which may causeConfigurationError(f'Module "{models_path}" not found')
later.With this PR, passing module objects directly instead of their paths can prevent those potential errors. Most editors/IDEs will alert developers immediatelly if there is something wrong.
Example:
Instead of:
Do this:
Checklist:
My change requires a change to the documentation.I have updated the documentation accordingly.