From 00c3ba2f196a3a04fb102a822474c896a9f1719e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20N=C3=BC=C3=9Flein?= <andreas@nuessle.in>
Date: Tue, 7 Apr 2015 16:54:35 +0200
Subject: [PATCH] get_db_prep_value on
year_lookup_bounds_for_date/datetime_field
---
django/db/models/fields/__init__.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py
index b305330..ca0863f 100644
a
|
b
|
class Field(RegisterLookupMixin):
|
776 | 776 | return [] |
777 | 777 | elif lookup_type == 'year': |
778 | 778 | if isinstance(self, DateTimeField): |
779 | | return connection.ops.year_lookup_bounds_for_datetime_field(value) |
| 779 | values = connection.ops.year_lookup_bounds_for_datetime_field(value) |
| 780 | return [self.get_db_prep_value(v, connection=connection, |
| 781 | prepared=prepared) for v in values] |
780 | 782 | elif isinstance(self, DateField): |
781 | | return connection.ops.year_lookup_bounds_for_date_field(value) |
| 783 | values = connection.ops.year_lookup_bounds_for_date_field(value) |
| 784 | return [self.get_db_prep_value(v, connection=connection, |
| 785 | prepared=prepared) for v in values] |
782 | 786 | else: |
783 | 787 | return [value] # this isn't supposed to happen |
784 | 788 | else: |