Думать над отображением статичных праздников
This commit is contained in:
1 parent
a78f9eea3b
commit
68c0204fc6
4 files changed
+13
-5
No files matched your search
+12
-4
@@ -48,12 +48,20 @@ class CarouselsAPIView(ListAPIView):
|
||||
|
||||
|
||||
def get(self, request):
|
||||
Carousels.objects.filter(Q(cdate__lt=datetime.now()) & ~Q(pk=4)).update(published=True)
|
||||
Carousels.objects.filter(Q(enddate__lt=datetime.now()) & ~Q(pk=4)).update(published=False)
|
||||
# Carousels.objects.filter(sender_id=6).update(published=True)
|
||||
#!!!!!!!!!!!!!!!!!!!!!! Как сдлать чтобы отпуск не трогали и другие статичные данные
|
||||
Carousels.objects.filter(Q(cdate__lt=datetime.now()) & ~Q(sender_id=6)).update(published=True)
|
||||
Carousels.objects.filter(Q(enddate__lt=datetime.now()) & ~Q(sender_id=6)).update(published=False)
|
||||
queryset = Carousels.objects.filter(published=True).order_by('-cdate')
|
||||
# !!!!!!!!!!!!!!!!!! Исправить на пользователя в системе
|
||||
vacation = GeneralVacation.objects.filter(user_id=15, planned_date__lt=datetime.now() + timedelta(days=7))
|
||||
print(vacation, '-----------------')
|
||||
# if vacation:
|
||||
# Carousels.objects.update(published=True)
|
||||
# else:
|
||||
# Carousels.objects.filter().update(published=False)
|
||||
# Carousels.objects.update_or_create(id=request.data['nowcomment']['id'],user_id=15, defaults={'comment':request.data['nowcomment']['comment'], 'time_create':datetime.datetime.now()})
|
||||
|
||||
vacation = GeneralVacation.objects.filter(user_id=15)
|
||||
print(vacation, self.request, 'vfg------------------')
|
||||
|
||||
result = []
|
||||
for x in queryset:
|
||||
|
||||
Reference in new issue
Block a user