Дни рождения
This commit is contained in:
1 parent
5aad8e52d6
commit
95ec564ca8
1 file changed
+8
-7
@@ -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
|
||||
|
||||
|
||||
Reference in new issue
Block a user