Skip to content

Instantly share code, notes, and snippets.

@rodrigoddc
Created November 27, 2019 18:44
Show Gist options
  • Select an option

  • Save rodrigoddc/9bacd1cd3fa8add4c2d0506a077f3504 to your computer and use it in GitHub Desktop.

Select an option

Save rodrigoddc/9bacd1cd3fa8add4c2d0506a077f3504 to your computer and use it in GitHub Desktop.
@property
def total_hora_extra(self):
if self.registrohoraextra_set.filter(utilizada=False) != 0:
total = self.registrohoraextra_set.filter(utilizada=False).aggregate(Sum('horas'))['horas__sum']
return total
else:
return 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment