我正在使用 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...
^
知道发生了什么吗?