Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fichas_report = Ficha.objects.filter(
- data_insercao__gte=now -timedelta(days=stDate),
- data_insercao__lte=now -timedelta(days=endDate)
- ).\
- extra(
- select={
- 'month': truncate_date,
- }).\
- values('unidadesaude__nome', 'month').\
- annotate(numero_fichas=Count('pk')).\
- order_by('-month')
Add Comment
Please, Sign In to add comment