Ticket #21643: fix_ftimedelta_querysets.patch

File fix_ftimedelta_querysets.patch, 916 bytes (added by anonymous, 11 years ago)
  • django/db/models/sql/expressions.py

    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):  
    111111    def evaluate_date_modifier_node(self, node, qn, connection):
    112112        timedelta = node.children.pop()
    113113        sql, params = self.evaluate_node(node, qn, connection)
     114        node.children.append(timedelta)
    114115
    115116        if (timedelta.days == timedelta.seconds == timedelta.microseconds == 0):
    116117            return sql, params
Back to Top