(self, compiler, connection)
| 186 | |
| 187 | class TupleGreaterThan(TupleLookupMixin, GreaterThan): |
| 188 | def get_fallback_sql(self, compiler, connection): |
| 189 | # Process right-hand-side to trigger sanitization. |
| 190 | self.process_rhs(compiler, connection) |
| 191 | # e.g.: (a, b, c) > (x, y, z) as SQL: |
| 192 | # WHERE a > x OR (a = x AND (b > y OR (b = y AND c > z))) |
| 193 | lookups = itertools.cycle([GreaterThan, Exact]) |
| 194 | connectors = itertools.cycle([OR, AND]) |
| 195 | cols_list = [col for col in self.lhs for _ in range(2)] |
| 196 | vals_list = [val for val in self.rhs for _ in range(2)] |
| 197 | cols_iter = iter(cols_list[:-1]) |
| 198 | vals_iter = iter(vals_list[:-1]) |
| 199 | col = next(cols_iter) |
| 200 | val = next(vals_iter) |
| 201 | lookup = next(lookups) |
| 202 | connector = next(connectors) |
| 203 | root = node = WhereNode([lookup(col, val)], connector=connector) |
| 204 | |
| 205 | for col, val in zip(cols_iter, vals_iter): |
| 206 | lookup = next(lookups) |
| 207 | connector = next(connectors) |
| 208 | child = WhereNode([lookup(col, val)], connector=connector) |
| 209 | node.children.append(child) |
| 210 | node = child |
| 211 | |
| 212 | return root.as_sql(compiler, connection) |
| 213 | |
| 214 | |
| 215 | class TupleGreaterThanOrEqual(TupleLookupMixin, GreaterThanOrEqual): |
nothing calls this directly
no test coverage detected