(self, connection, year)
| 703 | |
| 704 | class YearLookup(Lookup): |
| 705 | def year_lookup_bounds(self, connection, year): |
| 706 | from django.db.models.functions import ExtractIsoYear |
| 707 | |
| 708 | iso_year = isinstance(self.lhs, ExtractIsoYear) |
| 709 | output_field = self.lhs.lhs.output_field |
| 710 | if isinstance(output_field, DateTimeField): |
| 711 | bounds = connection.ops.year_lookup_bounds_for_datetime_field( |
| 712 | year, |
| 713 | iso_year=iso_year, |
| 714 | ) |
| 715 | else: |
| 716 | bounds = connection.ops.year_lookup_bounds_for_date_field( |
| 717 | year, |
| 718 | iso_year=iso_year, |
| 719 | ) |
| 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 |
no test coverage detected