(self, compiler, connection)
| 584 | # "as_postgresql" for postgres and so on, but as we don't know |
| 585 | # which DB we are running on, we need to use setattr. |
| 586 | def as_custom_sql(self, compiler, connection): |
| 587 | lhs_sql, lhs_params = self.process_lhs( |
| 588 | compiler, connection, self.lhs.lhs |
| 589 | ) |
| 590 | rhs_sql, rhs_params = self.process_rhs(compiler, connection) |
| 591 | params = lhs_params + rhs_params + lhs_params + rhs_params |
| 592 | return ( |
| 593 | "%(lhs)s >= " |
| 594 | "str_to_date(CONCAT(%(rhs)s, '-01-01'), '%%%%Y-%%%%m-%%%%d') " |
| 595 | "AND %(lhs)s <= " |
| 596 | "str_to_date(CONCAT(%(rhs)s, '-12-31'), '%%%%Y-%%%%m-%%%%d')" |
| 597 | % {"lhs": lhs_sql, "rhs": rhs_sql}, |
| 598 | params, |
| 599 | ) |
| 600 | |
| 601 | setattr( |
| 602 | CustomYearExact, |
nothing calls this directly
no test coverage detected