filter неделя

This commit is contained in:
zakhy 2025-04-17 09:21:05 +07:00
parent 0fa9707086
commit 77aa69aaad
2 changed files with 5 additions and 3 deletions

View File

@ -16,6 +16,7 @@ from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator
from django.db.models import Avg, Max, Min, Q
from django.http import HttpResponse, JsonResponse
from django.shortcuts import redirect, render
from django.utils import timezone
from django.views.decorators.cache import never_cache
from apps.general.views import settingsmodule
@ -33,8 +34,9 @@ from sabron.util import logging
def update_object(request):
try:
if request.method == "POST":
my_filter = Q(block=False)
object_list = Equipment.objects.filter(my_filter).all()
now = timezone.now()
week_diff = now - timedelta(days=7)
object_list = Equipment.objects.filter(block=False, time__gt=week_diff).all()
m_list = []
for obj in object_list:
type_g = obj.model.strip()

View File

@ -42,7 +42,7 @@ INSTALLED_APPS = [
"""Информация о приложении """
SITE_TITLE = "Многофункциональная система безопасности ОГР"
SITE_TITLE_S = "МФСБ ОГР"
APP_VER = "1.0.14.0"
APP_VER = "1.0.14.1"
APP_VEK = "2023 - 2025гг"
APP_COPPIRIGHT = "Многофункциональная система безопасности ОГР"