This commit is contained in:
Cja committed 2025-01-10 09:11:33 +03:00
1 parent 42ca054a5b
commit 16d0ee652c
2 files changed
+10 -14

No files matched your search

+1 -14
View File
@@ -4,18 +4,5 @@ from .views import *
urlpatterns = [
# path('get_for_thn/', GetForThn.as_view(),),
# path('get_for_bst/', GetForBst.as_view(),),
# path('setthanks/', SetThanks.as_view(), name=''),
# path('getthanks/', GetThanks.as_view(), name=''),
# path('setbest/', SetBest.as_view(), name=''),
# path('getbest/', GetBest.as_view(), name=''),
# path('getnotvotethn/', GetNotVoteThn.as_view()),
# path('getnotvotebst/', GetNotVoteBst.as_view()),
# path('getvoteinfo/', GetVoteInfo.as_view()),
path('getvotes/', GetVotes.as_view()),
]
+9
View File
@@ -5,4 +5,13 @@ from django.db.models import Q
from .models import *
from userauth.models import *
from .serializers import *
import datetime
class GetVotes(APIView):
def post(self, request):
now = datetime.datetime.now()
expired_votes = Vote.objects.filter(dateend__lt=now)
active_votes = Vote.objects.filter(dateend__gt=now)
serializer_class = VoteSerializer
return Response('ok')