django - "Conflicting models in application..." with external database tables -


i have project number of applications accesses both local mysql database 100s of tables, , several external mysql , ms-sql server databases many more tables. of external tables defined in models using "managed=false" meta data.

i upgraded django 1.6 1.7 following instructions in release notes , other hints, etc. stackoveflow.

everything seems working again exception of of applications access remote database tables. here example message:

runtimeerror: conflicting 'bugview_deferred_description_disposition_divisioaf59cb28117de5eb6ddfea0476dab601' models in application 'nvbugsdw': <class 'bug_metrics.models_bugs.bugview_deferred_description_disposition_divisioaf59cb28117de5eb6ddfea0476dab601'> , <class 'bug_metrics.models_bugs.bugview_deferred_description_disposition_divisioaf59cb28117de5eb6ddfea0476dab601'>. 

the table bugview defined in file names models_bugs.py follows:

class bugview(models.model): bugid            = models.bigintegerfield(primary_key=true) module           = models.charfield(max_length=128, null=false) requester        = models.charfield(max_length=128, null=false) qaengineer       = models.charfield(max_length=128, null=false) engineer         = models.charfield(max_length=128, null=false) requestdate      = models.datetimefield(null=false) modifieddate     = models.datetimefield(null=false) priority         = models.charfield(max_length=50, null=false) severity         = models.charfield(max_length=50, null=false) disposition      = models.charfield(max_length=64, null=false) bugaction        = models.charfield(max_length=64, null=false) origin           = models.charfield(max_length=64, null=false) geographicorigin = models.charfield(max_length=128, null=false) division         = models.charfield(max_length=64, null=false) synopsis         = models.charfield(max_length=256, null=false) description      = models.charfield(max_length=1024, null=false) bugtype          = models.charfield(max_length=50, null=false) originalbugid    = models.bigintegerfield()  class meta:     app_label = 'nvbugsdw'     managed   = false     db_table  = 'bugview' 

in views.py file class imported like:

from .models_bugs import bugview 

i tried

from models_bugs import bugview bug_metrics.models_bugs import bugview 

"bug_metrics" application name.

i followed of suggestions posted on https://code.djangoproject.com/ticket/22280 no effect.

i'm @ loss @ point. suggestions?

also, may not related, in trying debug issue (by dumping sys.path in manage.py), noticed code in manage.py executed twice when run command

./manage.py runserver --nothreading 0.0.0.0:8081 

my sys.path is:

/opt/graphic_tools/gtools /usr/local/lib/python2.7/dist-packages/south-0.8.4-py2.7.egg /usr/lib/python2.7 /usr/lib/python2.7/plat-linux2 /usr/lib/python2.7/lib-tk /usr/lib/python2.7/lib-old /usr/lib/python2.7/lib-dynload /usr/local/lib/python2.7/dist-packages /usr/lib/python2.7/dist-packages /usr/lib/python2.7/dist-packages/pil /usr/lib/python2.7/dist-packages/gst-0.10 /usr/lib/python2.7/dist-packages/gtk-2.0 /usr/lib/pymodules/python2.7 /usr/lib/python2.7/dist-packages/ubuntu-sso-client /usr/lib/python2.7/dist-packages/ubuntuone-client /usr/lib/python2.7/dist-packages/ubuntuone-control-panel /usr/lib/python2.7/dist-packages/ubuntuone-couch /usr/lib/python2.7/dist-packages/ubuntuone-installer /usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol 

"/opt/graphic_tools/gtools" project directory. not contain init.py file , contain of application sub-directories including "gtools" sub-directory.

one suggestion. did try synchronize 'remote' databases after upgrading new version of django? maybe not synced?

i assume have like: databases = {

'default': {some credentials},

'remote_db_name1': {some credentials},

'remote_db_name2': {some credentials}, ...

}

you can run

./manage.py migrate --database=remote_db_name1

./manage.py migrate --database=remote_db_name2

etc. (also, assume ran 'makemigrations' app before.)

the reason default migrate operates on 'default' db, others skipped.


Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -