Skip to content

Instantly share code, notes, and snippets.

@walison17
Created April 5, 2019 12:33
Show Gist options
  • Save walison17/2c5e8a27b2a46c7581da26399c343021 to your computer and use it in GitHub Desktop.
Save walison17/2c5e8a27b2a46c7581da26399c343021 to your computer and use it in GitHub Desktop.
class HistoricoManager(models.Manager):
def get_queryset(self):
qs = super().get_queryset()
qs.annotate(_valor_total=models.Sum('conta_set__valor'))
return qs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment