变量可以用在查询的.filter中吗

2024-05-18 04:27:28 发布

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

在python/Django中,在过滤器中使用变量的正确方法是什么?从概念上讲,我想这样做:

whereconditionfield = 'rate_of_interest'
whereoperator = 'gte'
arri = 50.0
myqsfiltered=myqs.objects.filter(whereconditionfield__whereoperator=arri)

这样的事情可能吗


Tags: ofdjango方法概念过滤器objectsratefilter