我想知道为什么会显示这个错误,我一直在使用Postgresql,并且我观察到当我在我的模型上使用IntegerField时会发生这个错误,比如这个 b2_sacnumber_id = models.IntegerField(blank=True, null=True)
,或者甚至在本地数据库中使用Integer字段。即使我在我的模型中使用了Intererfiled,是否有任何解决方案可以获得该值?我是新来的博士后,谁能给我解释一下这一点吗?这对我真的很有帮助
错误
LINE 1: ...sac_forms" WHERE "b2_sac_forms"."b2_sacnumber_id" IN (31718,...
^
HINT: No operator matches the given name and argument types. You might need to add explicit type casts.
queryviews.py
sample = ['31718','47060']
Sac_forms = list(B2SacForms.objects.using('matchy_data').values_list('b2_id', flat=True).filter(b2_sacnumber_id__in=sample))
我尝试的更改值sample
像这样sample = ['31718','47060']
或sample = ["31718","47060"]
,甚至我尝试了sample = [31718,47060]
,但仍然出现了错误
models.py
class B2SacForms(models.Model):
b2_id = models.IntegerField(blank=True, null=True)
b2_sacnumber_id = models.IntegerField(blank=True, null=True)
date = models.DateField(blank=True, null=True)
generated_id = models.IntegerField(blank=True, null=True)
class Meta:
managed = False
db_table = 'b2_sac_forms'
目前没有回答
相关问题 更多 >
编程相关推荐