【发布时间】:2017-11-17 16:34:58
【问题描述】:
当我尝试从表中获取数据时,应用程序名称会附加到表名称并显示错误。以下是我的代码。
from models import open_cart
class test(APIView):
def get(self,request,format=None):
values = open_cart.objects.get()
我在 installed_apps 中定义的应用名称是“MyApp”。我的表名称是“open_cart”。查询中的表名称为 MyApp_open_cart 而不是 open_cart。 我收到的错误消息是 relation "untitled_open_cart" 不存在
【问题讨论】:
-
发布您的模型以及设置文件
标签: django postgresql django-models django-rest-framework