我正在尝试执行原始sql查询,我收到以下错误:
relation "venue" does not exist
查询如下:
cityList = Venue.objects.raw("SELECT DISTINCT city FROM Venue")
我抓住的模型看起来像这样:
class Venue(models.Model):
name = models.CharField(max_length=150, blank=False)
description = models.CharField(max_length=1000)
image = models.ImageField(upload_to=imgUnique('venueMedia/venueImages'))
streetAddress= models.CharField(max_length=100)
city = models.CharField(max_length=100, blank=False)
state = models.CharField(max_length=100, blank=False)
这是一个语法错误,我很难找到有关正确语法的正确文档。在粗略的查询上似乎有很多,但我还没准备好放弃这个
答案 0 :(得分:0)