We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi
Nice idea
what would be nice is to have some global connection configuration... like in one module you do:
client = mongox.Client( "mongodb://localhost:27017", get_event_loop=asyncio.get_running_loop ) mongox.set_default_client("mongodb://localhost:27017", get_event_loop=asyncio.get_running_loop)
and then in places where I define models:
class Movie(mongox.Model): name: str year: int # !!! no Meta
Now Movie should get client from set_default_client and collection name will become "movie" (lowercase from model name)
set_default_client
"movie"
to override collection
class Movie(mongox.Model, collection="movies"): name: str year: int
The text was updated successfully, but these errors were encountered:
Thanks a lot for the suggestion. I think that would be nice.
I'll take a look into it but feel free to create PR for it.
Sorry, something went wrong.
🐛 new update, bug aminalaee#4 fixed
6c7070f
No branches or pull requests
Hi
Nice idea
what would be nice is to have some global connection configuration... like in one module you do:
and then in places where I define models:
Now Movie should get client from
set_default_client
and collection name will become"movie"
(lowercase from model name)to override collection
The text was updated successfully, but these errors were encountered: