Anup, look after to_sql method, tables need to be sorted against the expressions order, then, for the jointure, we need other tables.
If I search against "categ_id", the only expression when KeyError is: ('categ_id', 'in', [...some integers...])
Table 'product_template' should be at index 0 (the value id "i", not "index").
so we cannot write: 123(or 2) self.__tables[index] = working_table but we have to let 123(or 2) self.__tables[i] = working_table
Anup, look after to_sql method, tables need to be sorted against the expressions order, then, for the jointure, we need other tables.
If I search against "categ_id", the only expression when KeyError is:
('categ_id', 'in', [...some integers...])
Table 'product_template' should be at index 0 (the value id "i", not "index").
so we cannot write: tables[ index] = working_table
123(or 2) self.__
but we have to let
123(or 2) self.__tables[i] = working_table