Closed unaxfromsibiria closed 9 years ago
Great idea. I'll put it in my TODO list. Thanks.
after version 0.4.0 forced to replace cursor as:
try:
SomeModelClass.architect.operation.cursor = connections['some_not_default_connection'].cursor()
except ConnectionDoesNotExist:
# use default
pass
I think good idea a give native opportunity for replacing feature classes, like this:
from architect.orms.django.features import PartitionFeature
class CustomPartitionFeature(PartitionFeature):
def __init__(self, *args, **kwargs):
super(PartitionFeature, self).__init__(*args, **kwargs)
self.cursor = connections['some_not_default_connection'].cursor()
SomeModelClass.architect.set_feature_class('partition', CustomPartitionFeature)
This will be usefull for resolving other users needs, not only replacing cursor :)
Support for multiple database connections in Django and custom features are available in v0.5.0
thanks!
if has more one db connection, have to do like this:
I would like something native implementation for this. Please, think about.