Created
May 4, 2020 11:28
-
-
Save manuelgeek/cb9ff28349dd46705bd58d645f974068 to your computer and use it in GitHub Desktop.
Simple Django gist to show count
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_count(self, request, *args, **kwargs): | |
recons_0 = ReconStatus.objects.filter(ageing_days__range=[0,30], deleted=False).count() | |
recons_30 = ReconStatus.objects.filter(ageing_days__range=[30,60], deleted=False).count() | |
recons_60 = ReconStatus.objects.filter(ageing_days__range=[60,90], deleted=False).count() | |
recons_90 = ReconStatus.objects.filter(ageing_days__gte = 90, deleted=False).count() | |
return Response({'recons_0': recons_0, 'recons_30': recons_30, 'recons_60': recons_60, 'recons_90': recons_90}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment