我正在尝试执行 Django 查询:
#att.name is a string
kwargs = {att.name : F('node__product__' + att.name) }
temps = Temp.objects.exclude(**kwargs)
我想知道这是否正确。到目前为止,我看到的所有示例都在值中使用字符串,但是如果值是函数,我应该像这样将值设为字符串吗?
kwargs = {att.name : 'F('node__product__' + att.name)' }
值中的函数是在参数列表中急切执行还是等到需要时才执行?