From f2c7c9e9c3f0100b1ac320fcd10c14172c005934 Mon Sep 17 00:00:00 2001 From: Slava Kyrachevsky Date: Thu, 15 Jun 2017 11:47:48 +0300 Subject: [PATCH] =?UTF-8?q?t83:=20=D1=84=D0=B8=D0=BA=D1=81=20=D0=BE=D1=82?= =?UTF-8?q?=D0=BE=D0=B1=D1=80=D0=B0=D0=B6=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=BF?= =?UTF-8?q?=D0=BE=D0=B8=D1=81=D0=BA=D0=B0=20=D0=BF=D1=80=D0=BE=D1=88=D0=B5?= =?UTF-8?q?=D0=B4=D1=88=D0=B8=D1=85=20=D1=81=D0=BE=D0=B1=D1=8B=D1=82=D0=B8?= =?UTF-8?q?=D0=B9=20=D1=81=20=D1=83=D1=87=D1=91=D1=82=D0=BE=D0=BC=20=D1=82?= =?UTF-8?q?=D0=B5=D0=B3=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/functions/custom_views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/functions/custom_views.py b/apps/functions/custom_views.py index b4f26f5e..996cbdc6 100644 --- a/apps/functions/custom_views.py +++ b/apps/functions/custom_views.py @@ -569,6 +569,7 @@ class ReverseOrderMixin(ContextMixin): if isinstance(children, tuple): if children[0].startswith('data_begin'): continue + childrens.append(children) elif isinstance(children, SearchNode): node_childrens = list(filter(lambda x: not x[0].startswith('data_begin'), children.children)) if node_childrens: @@ -577,7 +578,8 @@ class ReverseOrderMixin(ContextMixin): qs.query.query_filter.children = childrens self.extra_ctx['events_reversed'] = True qs.query.clear_order_by() - return qs.filter(data_begin__lte=datetime.now()).order_by('-data_begin') + qs = qs.filter(data_begin__lte=datetime.now()).order_by('-data_begin') + return qs def get_queryset(self): qs = super(ReverseOrderMixin, self).get_queryset()