maxtepkeev / architect

A set of tools which enhances ORMs written in Python with more features
Other
391 stars 57 forks source link

Use Django DB Routers to determine the correct database for a model #30

Closed lig closed 8 years ago

lig commented 8 years ago

Django ConnectionMixin supports DEFAULT_DB_ALIAS only. https://github.com/maxtepkeev/architect/blob/master/architect/orms/django/features.py#L20

There should be support for multi db Django configuration https://docs.djangoproject.com/en/1.9/topics/db/multi-db/

maxtepkeev commented 8 years ago

Architect supports multi databases in Django, see docs, specifically the db option where you need to set the connection name used for this model. DEFAULT_DB_ALIAS is used when db option isn't set.

lig commented 8 years ago

Thank you for the clarification. I will try that option.

lig commented 8 years ago

However, it looks like using django db router to determine the correct DB Alias for the Model by default will be much more handy.

maxtepkeev commented 8 years ago

Agree, however this isn't implemented at the moment, so we'll keep this issue open until I have time to do that or somebody will make a pull request.

maxtepkeev commented 8 years ago

Added in v0.5.4.