Added missed function

This commit is contained in:
benjamyn 2020-10-21 03:10:30 -04:00
parent f9c071aa43
commit c905ad8d5f

View File

@ -21,6 +21,12 @@ class MigrationViewSet(viewsets.ModelViewSet):
response = {"message": "this will be upcoming migrations"}
return Response(response, status=status.HTTP_200_OK)
@action(detail=False, methods=['GET'])
def missed(self, request, *args, **kwargs):
response = {"message": str(Migration.objects.filter(
booked_time__gte=timezone.now()).order_by('-booked_time')[:5])}
return Response(response, status=status.HTTP_200_OK)
class IndexView(generic.ListView):
template_name = 'api/index.html'