[英]How to convert mysql query to django orm
As de error suggests the SELECT clause must contain the primary key in order to be able to build the ORM object. By default, the primary key is a column named pk.由于 de error 建议 SELECT 子句必须包含主键才能构建 ORM object。默认情况下,主键是一个名为 pk 的列。 I advise using "SELECT *" in this case if possible, maybe the "AS" could give problems too.
如果可能的话,我建议在这种情况下使用“SELECT *”,也许“AS”也会带来问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.