mypebble / django-pgviews

Fork of django-postgres that focuses on maintaining and improving support for Postgres SQL Views.
The Unlicense
195 stars 41 forks source link

Use Django Database routing #32

Open GeorgeLubaretsi opened 7 years ago

GeorgeLubaretsi commented 7 years ago

In our project we use multiple databases. They are chosen based on Model's app name.

Here's the documentation: https://docs.djangoproject.com/en/1.11/topics/db/multi-db/#using-routers

This change makes sure routers are taken into account when creating a connection

scott-w commented 7 years ago

Hi @GeorgeLubaretsi, thanks for this!

Are you able to pull together a test, or modify the tests, to demonstrate this working?

scott-w commented 6 years ago

Hi @GeorgeLubaretsi, I'd still like to merge this in. If you'd like some help putting a test case together, I'm more than happy to work through it with you =)

GeorgeLubaretsi commented 6 years ago

Hey @scott-w I really don't have much time at the moment :( I'll try to come up with something over the next weekend

scott-w commented 6 years ago

Hi @GeorgeLubaretsi, no worries. Just keep me updated and I'll be happy to put some time aside to work with you.

mikicz commented 3 years ago

My fork now this supports this as of version 0.8.0. See https://github.com/mikicz/django-pgviews and https://pypi.org/project/django-pgviews-redux/.