defget_day(self):""" Return the day for which this view should display data. """day=self.dayifdayisNone:try:day=self.kwargs['day']exceptKeyError:try:day=self.request.GET['day']exceptKeyError:raiseHttp404(_("No day specified"))returnday
Get a day format string in strptime syntax to be used to parse the day
from url variables.
144
145
146
147
148
149
defget_day_format(self):""" Get a day format string in strptime syntax to be used to parse the day from url variables. """returnself.day_format
Get the next valid day.
166
167
168
169
170
defget_next_day(self,date):""" Get the next valid day. """return_get_next_prev(self,date,is_previous=False,period='day')
Get the previous valid day.
172
173
174
175
176
defget_previous_day(self,date):""" Get the previous valid day. """return_get_next_prev(self,date,is_previous=True,period='day')
Возвращает дату начала текущего интервала.
186
187
188
189
190
def_get_current_day(self,date):""" Return the start date of the current interval. """returndate
Возвращает дату начала следующего интервала.
Интервал определяется датой начала <= дата элемента < следующая дата начала.
178
179
180
181
182
183
def_get_next_day(self,date):""" Return the start date of the next interval. The interval is defined by start date <= item date < next start date. """returndate+datetime.timedelta(days=1)