summaryrefslogtreecommitdiff
path: root/django/db/models/sql
diff options
context:
space:
mode:
Diffstat (limited to 'django/db/models/sql')
-rw-r--r--django/db/models/sql/where.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/django/db/models/sql/where.py b/django/db/models/sql/where.py
index a9fca7df11..9ce1e7bf2d 100644
--- a/django/db/models/sql/where.py
+++ b/django/db/models/sql/where.py
@@ -66,6 +66,8 @@ class WhereNode(tree.Node):
# here in the future (using Python types is suggested for consistency).
if isinstance(value, datetime.datetime):
annotation = datetime.datetime
+ elif hasattr(value, 'value_annotation'):
+ annotation = value.value_annotation
else:
annotation = bool(value)