私はこの奇妙な振る舞いをしています
test_dict = {'productDue' : ['foo'],'releaseDue' : ['bar']}
for attr, value in test_dict.items() :
print attr
and_args = [(and_(getattr(my_table,attr).in_(value)))]
これは私に与えます:
>>> print and_(*and_args)
"my_table"."releaseDue" IN (:releaseDue_1)
次に、順序を切り替えると:
test_dict = {'releaseDue' : ['bar'],'productDue' : ['foo']}
for attr, value in test_dict.items() :
print attr
and_args = [(and_(getattr(my_table,attr).in_(value)))]
私は得る:
>>> print and_(*and_args)
"TDC"."releaseDue" IN (:releaseDue_1)
わからない、持ちたい"TDC"."releaseDue" IN (:releaseDue_1) AND "TDC"."productDue" IN (:productDue_1)
助けてください