Дни рождения
This commit is contained in:
1 parent
5aad8e52d6
commit
95ec564ca8
1 file changed
+7
-6
@@ -85,7 +85,7 @@ class CarouselsAPIView(ListAPIView):
|
|||||||
def get(self, request):
|
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 = []
|
result = []
|
||||||
for x in queryset:
|
for x in queryset:
|
||||||
@@ -113,13 +113,14 @@ class CarouselsAPIView(ListAPIView):
|
|||||||
|
|
||||||
"sender": "/media/default/dr.png",
|
"sender": "/media/default/dr.png",
|
||||||
}
|
}
|
||||||
birthday = []
|
# birthday = []
|
||||||
|
|
||||||
if len(nowday) > 0 :
|
if len(nowday) > 0 :
|
||||||
|
|
||||||
|
|
||||||
brdtext = BirthdayText.objects.order_by("?")[:len(nowday)]
|
brdtext = BirthdayText.objects.order_by("?")[:len(nowday)]
|
||||||
|
|
||||||
result.append(birthday)
|
|
||||||
for k in nowday:
|
for k in nowday:
|
||||||
|
|
||||||
result.append({
|
result.append({
|
||||||
@@ -131,9 +132,9 @@ class CarouselsAPIView(ListAPIView):
|
|||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
result.append(allbirthday)
|
||||||
# print(result, 'result ------------------------------------')
|
print(result, 'result ------------------------------------')
|
||||||
# print(allbirthday, 'allbirthday ------------------------------------')
|
print(allbirthday, 'allbirthday ------------------------------------')
|
||||||
# print(birthday, 'birthday ------------------------------------')
|
# print(birthday, 'birthday ------------------------------------')
|
||||||
# result = [allbirthday] + birthday+ result
|
# result = [allbirthday] + birthday+ result
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user