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
using
If I have a block like so, is this still acceptable?
with in_database('external'): MyModel.objects.using('other_db').filter(field='value')
The text was updated successfully, but these errors were encountered:
I know it's been a long time but in case someone needs it
use an alias
db_connection = {'NAME': 'name', 'USER': 'user', 'PASSWORD': 'password', 'HOST': '127.0.0.1', 'PORT': 5432, 'ENGINE': 'django.db.backends.postgresql'} with in_database(db_connection) as data_base_config: new_db = data_base_config.database return MyModel.objects.using(new_db).filter(field='value')
Sorry, something went wrong.
No branches or pull requests
If I have a block like so, is this still acceptable?
with in_database('external'): MyModel.objects.using('other_db').filter(field='value')
The text was updated successfully, but these errors were encountered: