pyodb package connects to SQLSERVER 2008 and does not get data

1

I am working with python 3.5.4 and django 1.11.13 install pyodbc and pyodbc-azure, it connects but it does not make any sql, here I put an image of the code and the debugging with the answer , also probe with

'DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'db_app1',
        'USER': 'postgres',
        'PASSWORD': 'postgres',
        'HOST': 'localhost',
        'PORT': '5432',
    },
    'db_app2': {
        'ENGINE': 'sql_server.pyodbc',  # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
        'NAME': 'db_app2',  # Or path to database file if using sqlite3.
        'USER': 'sa',  # Not used with sqlite3.
        'PASSWORD': '*****',  # Not used with sqlite3.
        'HOST': 'localhost',  # Set to empty string for localhost. Not used with sqlite3.
        'PORT': '1433',  # Set to empty string for default. Not used with sqlite3.
        'OPTIONS':{ 'driver':'SQL Server Native Client 10.0'},
    }
}
'

this is the fields of one of the tables after inspectdb

class FinDocumento(models.Model):
  iddocumento = models.AutoField(primary_key=True)
 nrodoc = models.CharField(max_length=15)
 estado = models.ForeignKey('FinEstadooperacion', models.DO_NOTHING,   db_column='estado')
descripcion = models.CharField(max_length=7950, blank=True, null=True)
idregdoc = models.ForeignKey('FinRegdocum', models.DO_NOTHING, db_column='idregdoc')
validado = models.BooleanField()
idactividad = models.ForeignKey(FinActividad, models.DO_NOTHING, db_column='idactividad')
idunidad = models.ForeignKey('GenUnidadcontable', models.DO_NOTHING, db_column='idunidad')
fechaemision = models.DateTimeField()
fechaprocesam = models.DateTimeField()
crc = models.BigIntegerField()

class Meta:
    managed = False
    db_table = 'fin_documento'

and it does not connect to db_app2 either, this database is for queries only since this database can be local or external, probe doing the inspectdb and created the models for me but it does not do them either, which will be missing

    
asked by Antonio 15.08.2018 в 16:51
source

0 answers