From 562aebdcae16cb4b7f13f66d86cb2cb94dc48263 Mon Sep 17 00:00:00 2001
From: Alexey Voronov <despawn@gmail.com>
Date: Fri, 20 Dec 2013 13:36:29 +0300
Subject: [PATCH] Make it possible to evaluate querysets using F()+timedelta()
more than once.
---
django/db/models/sql/expressions.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/django/db/models/sql/expressions.py b/django/db/models/sql/expressions.py
index bd661b5..9f29e2a 100644
a
|
b
|
class SQLEvaluator(object):
|
111 | 111 | def evaluate_date_modifier_node(self, node, qn, connection): |
112 | 112 | timedelta = node.children.pop() |
113 | 113 | sql, params = self.evaluate_node(node, qn, connection) |
| 114 | node.children.append(timedelta) |
114 | 115 | |
115 | 116 | if (timedelta.days == timedelta.seconds == timedelta.microseconds == 0): |
116 | 117 | return sql, params |