Return the month for which this view should display data.
80
81
82
83
84
85
86
87
88
89
90
91
defget_month(self):"""Return the month for which this view should display data."""month=self.monthifmonthisNone:try:month=self.kwargs['month']exceptKeyError:try:month=self.request.GET['month']exceptKeyError:raiseHttp404(_("No month specified"))returnmonth
Get a month format string in strptime syntax to be used to parse the
month from url variables.
73
74
75
76
77
78
defget_month_format(self):""" Get a month format string in strptime syntax to be used to parse the month from url variables. """returnself.month_format
Get the next valid month.
93
94
95
defget_next_month(self,date):"""Get the next valid month."""return_get_next_prev(self,date,is_previous=False,period='month')
Get the previous valid month.
97
98
99
defget_previous_month(self,date):"""Get the previous valid month."""return_get_next_prev(self,date,is_previous=True,period='month')
Возвращает дату начала текущего интервала.
115
116
117
def_get_current_month(self,date):"""Return the start date of the previous interval."""returndate.replace(day=1)
Возвращает дату начала следующего интервала.
Интервал определяется датой начала <= дата элемента < следующая дата начала.
101
102
103
104
105
106
107
108
109
110
111
112
def_get_next_month(self,date):""" Return the start date of the next interval. The interval is defined by start date <= item date < next start date. """ifdate.month==12:try:returndate.replace(year=date.year+1,month=1,day=1)exceptValueError:raiseHttp404(_("Date out of range"))else:returndate.replace(month=date.month+1,day=1)