#12540: Add support for cross-database foreign keys and m2m
---------------------------------------------------+------------------------
          Reporter:  russellm                      |         Owner:  nobody   
            Status:  new                           |     Milestone:           
         Component:  Database layer (models, ORM)  |       Version:  1.2-alpha
        Resolution:                                |      Keywords:           
             Stage:  Accepted                      |     Has_patch:  0        
        Needs_docs:  0                             |   Needs_tests:  0        
Needs_better_patch:  0                             |  
---------------------------------------------------+------------------------
Comment (by zbraniecki):

 I suggest also adding config parameters that would bind apps in a project
 to a given database. Something like:

 settings.py
 DATABASES = {
     'default': {
         'NAME': 'db1',
         'ENGINE': 'django.db.backends.mysql',
         'USER': 'root',
         'PASSWORD': '',
     },
     'db2': {
         'NAME': 'db2',
         'ENGINE': 'django.db.backends.mysql',
         'USER': 'root',
         'PASSWORD': '',
     }
 }

 INSTALLED_APPS = (
     {'NAME':'app1', 'DEFAULT_DB': 'db1'},
     {'NAME':'app2', 'DEFAULT_DB': 'db2'},
 )

 this would allow models to be able to discover that the ForeignKey
 referenced in app1.models is using db2. It would also allow for models in
 app1 to on save() add required records to models from app2 without having
 to explicitly use using() on them (which would constrain the app
 relations)

 Does it sounds reasonable? Is it a material for a separate ticket?

-- 
Ticket URL: <http://code.djangoproject.com/ticket/12540#comment:3>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.


Reply via email to