Get the total values in each month using Django QuerySet -


This model is for (overtime). class overtime (incase): day = model. I need to remove the total value for each month. I now use a daily quercet in the manager. I am doing
  class overtime manager (models.Manager): def daily_report (self): return self.values ​​('day'). Annotated (hour = model ('' value '')). The order ('- day')   

However now I need a monthly report which will be the sum of value for each month. I tried to remove the first month but then I lose the value.

Note: In the month should not be the total amount for all the years, especially me month, year Div class = "post-text" itemprop = "text">

If you are using Postgresql, you can do this. There are futures similar to OCD.

  overtime.obbs.ctroy ({'month': "to_char (day, 'soma)", "year": "remove (day to year)"    

Comments

Popular posts from this blog

Out of index C/C++ -

regex - PatternSyntaxException: while using String.ReplaceAll function in java? -

java - Projects which are accessed via multiple (different) IDEs: Ant or Maven? -