Skip to content

table not found for models stored in secondary database  #25

@moccand

Description

@moccand

Some of my models are store in a dedicated database and using :

in settings.py :

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': BASE_DIR / 'db.sqlite3',
    },
    'catalog': {
        'ENGINE': 'django.contrib.gis.db.backends.postgis',
        ...
        'PORT': '5432',
    }

in models.py :

    class Meta:
        managed = False
        db_table = '__mytable'

and in my modelAdmin classes :
using = 'catalog'

makes an exception : no such table: __mytable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions