关系“api_variant”的列“reference_sequence”不存在

时间:2013-03-31 02:25:45

标签: python django django-models

我正在使用django来编写应用程序。

我使用以下代码

定义了一个模型
class Variant(models.Model):
    partOf = models.TextField()
    rawFile = models.CharField(max_length = 200)
    CHROM = models.CharField(max_length = 200)
    start = models.IntegerField()
    end = models.IntegerField()
    ALT = models.CharField(max_length = 200)
    FILTER = models.CharField(max_length = 200)
    info_name = models.TextField()
    info_description = models.TextField()
    info_value = models.TextField()
    reference_sequence = models.CharField(max_length = 200)
    sample_sequence = models.TextField()
    format_name = models.TextField()
    format_description = models.TextField()
    format_value = models.TextField()

然后写入模型的视图:

def readVariantToDb(request):
    variant = Variant.objects.create(
              partOf = '',
              rawFile = '',
              CHROM = '',
              start = 0,
              end = 0,
              ALT = '',
              FILTER = '',
              info_name = '',
              info_description = '',
              info_value = '',
              reference_sequence = '',
              sample_sequence = '',
              format_name = '',
              format_description = '',
              format_value = '')
    variant.save()
    return HttpResponse('File Read')

然后系统显示:

column "reference_sequence" of relation "api_variant" does not exist
LINE 1: ...", "info_name", "info_description", "info_value", "reference...
                                                             ^

知道发生了什么事吗?

0 个答案:

没有答案