基于Django中另一个字段值的条件

2024-04-25 14:39:50 发布

您现在位置:Python中文网/ 问答频道 /正文

我有一张结构如下的桌子:

==========================================
itemName minPrice maxPrice curPrice
========================================== 
   A         10      20        8 
   B         15      25        12
   c         20      30        25

mysql就是这样

select * from Items where curPrice<minPrice

但是我想要在django中返回“A,B item name result”。你知道吗

我已经试过用过滤器,但没有成功。你知道吗


Tags: djangonamefrommysqlitemsresultitemwhere