From 95ec564ca8db53021c7ed34a3f36e2b310d31750 Mon Sep 17 00:00:00 2001 From: iriska-gri <79623434+iriska-gri@users.noreply.github.com> Date: Fri, 24 Nov 2023 13:06:16 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BD=D0=B8=20=D1=80=D0=BE=D0=B6=D0=B4?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/navigation/views.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/navigation/views.py b/src/navigation/views.py index cbe89bf77..9ed911366 100644 --- a/src/navigation/views.py +++ b/src/navigation/views.py @@ -85,7 +85,7 @@ class CarouselsAPIView(ListAPIView): def get(self, request): - queryset = Carousels.objects.filter(published=True, cdate__lte=datetime.now(), enddate__gte=datetime.now()).order_by('order','sender__order') + queryset = Carousels.objects.filter(published=True, cdate__lte=datetime.now(), enddate__gte=datetime.now()).order_by('sender__order') result = [] for x in queryset: @@ -113,13 +113,14 @@ class CarouselsAPIView(ListAPIView): "sender": "/media/default/dr.png", } - birthday = [] + # birthday = [] + if len(nowday) > 0 : brdtext = BirthdayText.objects.order_by("?")[:len(nowday)] - result.append(birthday) + for k in nowday: result.append({ @@ -129,11 +130,11 @@ class CarouselsAPIView(ListAPIView): "published": 'true', "sender": "/media/default/dr.png", }) - + - - # print(result, 'result ------------------------------------') - # print(allbirthday, 'allbirthday ------------------------------------') + result.append(allbirthday) + print(result, 'result ------------------------------------') + print(allbirthday, 'allbirthday ------------------------------------') # print(birthday, 'birthday ------------------------------------') # result = [allbirthday] + birthday+ result