Как мне получить некоторый результат в файле django models.py в миграциях

Я новичок в django, я пытаюсь получить некоторый вывод в файле models.py в миграциях, как мне исправить ошибку в файле models.py. Я удалил свой файл 0001_initial.py и файл db.sqlite3 и запустил python manage.py makemigrations, python manage.py migrate, python manage.py inspectdb hospital Calculo.But It doesn't help.

База данных, которую я использую

DATABASES = {
    'default': {
        enter code here'ENGINE': 'django.db.backends.sqlite3',
        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
    }
}

Таблицы в моем файле 0001_initial.py

class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Calculo',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('registration_date', models.DateTimeField(auto_now_add=True)),
                ('latitude', models.FloatField()),
                ('longitude', models.FloatField()),
            ],
        ),
        migrations.CreateModel(
            name='Hospital',
            fields=[
                ('ID', models.IntegerField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('YEAR', models.IntegerField()),
                ('CLUES', models.CharField(max_length=15)),
                ('INSTITUTION_KEY', models.CharField(max_length=10)),
                ('MUNICIPALITY_KEY', models.IntegerField()),
                ('LATITUDE', models.FloatField(max_length=15)),
                ('LONGITUDE', models.FloatField(max_length=15)),
                ('DISTANCE', models.FloatField(max_length=5)),
                ('TRANSFER_TIME', models.FloatField(max_length=5)),
                ('NAME_OF_THE_UNIT', models.CharField(max_length=255)),
                ('TOTAL_OFFICES', models.IntegerField(null=True)),
                ('TOTAL_BEDS_IN_HOSPITALIZATION_AREA', models.IntegerField(null=True)),
                ('TOTAL_BEDS_IN_OTHER_NON_HOSP_AREAS', models.IntegerField(null=True)),
                ('TOTAL_GENERAL_PHYSICIANS_AND_SPECIALISTS', models.IntegerField(null=True)),
                ('NUMBER_OF_NURSES_IN_CONTACT_WITH_THE_PATIENT', models.IntegerField(null=True)),
            ],
        ),
    ]

Ошибка в файле model.py в migrations

# This is an auto-generated Django model module.
# You'll have to do the following manually to clean this up:
#   * Rearrange models' order
#   * Make sure each model has one field with primary_key=True
#   * Make sure each ForeignKey and OneToOneField has `on_delete` set to the desired behavior
#   * Remove `managed = False` lines if you wish to allow Django to create, modify, and delete the table
# Feel free to rename the models, but don't rename db_table values or field names.
from django.db import models
# Unable to inspect table 'hospital'
# The error was: Table hospital does not exist (empty pragma).
# Unable to inspect table 'Calculo'
# The error was: Table Calculo does not exist (empty pragma).
# Unable to inspect table '...'
# The error was: Table ... does not exist (empty pragma).
# This is an auto-generated Django model module.
# You'll have to do the following manually to clean this up:
#   * Rearrange models' order
#   * Make sure each model has one field with primary_key=True
#   * Make sure each ForeignKey and OneToOneField has `on_delete` set to the desired behavior
#   * Remove `managed = False` lines if you wish to allow Django to create, modify, and delete the table
# Feel free to rename the models, but don't rename db_table values or field names.
from django.db import models
# Unable to inspect table 'hospital,'
# The error was: Table hospital, does not exist (empty pragma).
# Unable to inspect table 'Calculo'
# The error was: Table Calculo does not exist (empty pragma).
# Unable to inspect table '...'
# The error was: Table ... does not exist (empty pragma).
Вернуться на верх