bernardopires / django-tenant-schemas

Tenant support for Django using PostgreSQL schemas.
https://django-tenant-schemas.readthedocs.org/en/latest/
MIT License
1.46k stars 424 forks source link

Handle multiple tenant-aware database connections #582

Closed JamesMaroney closed 10 months ago

JamesMaroney commented 5 years ago

I have some special requirements that cause me to have multiple defined database connections to the same tenant schemas (just with different postgres users). For this to work out properly, I had to beef up some of the method in utils.py to operate on django.db.connections instead of django.db.connection.

I tried to make sure that the updates are backwards compatible, but am open fixing anything I may have missed.

Let me know if there are any updates to documentation or tests that you'd like to see before considering this Pull Request. I'm assuming you'd want some documentation updates to cover the updated utils behavior.