(self, compiler, connection)
| 720 | return bounds |
| 721 | |
| 722 | def as_sql(self, compiler, connection): |
| 723 | # Avoid the extract operation if the rhs is a direct value to allow |
| 724 | # indexes to be used. |
| 725 | if self.rhs_is_direct_value(): |
| 726 | # Skip the extract part by directly using the originating field, |
| 727 | # that is self.lhs.lhs. |
| 728 | lhs_sql, params = self.process_lhs(compiler, connection, self.lhs.lhs) |
| 729 | rhs_sql, _ = self.process_rhs(compiler, connection) |
| 730 | rhs_sql = self.get_direct_rhs_sql(connection, rhs_sql) |
| 731 | start, finish = self.year_lookup_bounds(connection, self.rhs) |
| 732 | params = (*params, *self.get_bound_params(start, finish)) |
| 733 | return "%s %s" % (lhs_sql, rhs_sql), params |
| 734 | return super().as_sql(compiler, connection) |
| 735 | |
| 736 | def get_direct_rhs_sql(self, connection, rhs): |
| 737 | return connection.operators[self.lookup_name] % rhs |
nothing calls this directly
no test coverage detected