Django models 从django中的抽象模型继承时出错

Django models 从django中的抽象模型继承时出错,django-models,django-1.8,Django Models,Django 1.8,首先,我读了很多书,但没有找到答案 我有一个django项目,在该项目中我有一些应用程序,更具体地说 DJANGO-PROJECT *--------- app_base *--------- app_equipment *--------- app_customer then app_base is the app for code that is common to the other apps, in my case i have a models.py fil

首先,我读了很多书,但没有找到答案

我有一个django项目,在该项目中我有一些应用程序,更具体地说

DJANGO-PROJECT
    *--------- app_base
    *--------- app_equipment
    *--------- app_customer


then app_base is the app for code that is common to the other apps, in my case i have a models.py file a class who has a class:

from django.db import models
from datetime import date
import project_name.utilies as ut

class BaseModel():   
    status = models.CharField( max_length = 1, choices = ut.STATUS_CHOICES, default = 1 )
    created_date =  models.DateField( default = date.today ) 
    last_modified_date = models.DateField( null = True )
    deleted_date = models.DateField( null = True )
    createdby_id = models.IntegerField( default = 0 )
    modifiedby_id = models.IntegerField( default = 0 )

    class Meta:
        abstract=True
然后在app_设备中,我有另一个models.py文件,在该文件中我有下一个类:

from django.db import models
from app_base.models import BaseModel

class Equipment(BaseModel):
    name = models.CharField( max_length = 250 , default="")
    image = models.CharField( max_length = 250 , default="" )
    desc = models.TextField( default="")
    horsepower = models.IntegerField( default = 0 )
    fuelcapacity = models.IntegerField( default = 0 )
    model = models.CharField( max_length = 250 , default="" ) 
    year = models.IntegerField( default = 0 , )
    purchasecost = models.IntegerField( default = 0 )

    class Meta:    
        db_table = "equipment"
因此,设备是从BaseModel扩展而来的,或者我在django文档中读到的错误是,当我想要执行commandmakemigrations时,我得到一个错误:

您试图在没有默认值的情况下向设备添加不可为空的字段“id”;我们不能这样做(数据库需要一些东西来填充现有的行)。 请选择一个修复程序: 1) 立即提供一次性默认值(将在所有现有行上设置) 2) 退出,让我在models.py中添加一个默认值

我不知道如何解决这个问题,我一直在尝试输入id字段,但什么都没有发生,有些人说错误在于清除,但不同文件和应用程序的哪一部分是清除的

当我不继承抽象模型时,错误就解决了,但我想在其他模型的每个表中使用BaseModel中的所有这些属性

提前谢谢各位