class DayMixin
from django.views.generic.dates import DayMixin
Attributes
Defined in | |
---|---|
day = None
|
DayMixin |
day_format = '%d'
|
DayMixin |
Methods
def
get_day(self):
DayMixin
¶
def
get_day(self):
DayMixin
¶
Return the day for which this view should display data
89 90 91 92 93 94 95 96 97 98 99 100 | def get_day(self):
"Return the day for which this view should display data"
day = self.day
if day is None:
try:
day = self.kwargs['day']
except KeyError:
try:
day = self.request.GET['day']
except KeyError:
raise Http404(_(u"No day specified"))
return day
|
def
get_day_format(self):
DayMixin
¶
def
get_day_format(self):
DayMixin
¶
Get a day format string in strptime syntax to be used to parse the day from url variables.
82 83 84 85 86 87 | def get_day_format(self):
"""
Get a day format string in strptime syntax to be used to parse the day
from url variables.
"""
return self.day_format
|
def
get_next_day(self, date):
DayMixin
¶
def
get_next_day(self, date):
DayMixin
¶
Get the next valid day.
102 103 104 105 106 107 | def get_next_day(self, date):
"""
Get the next valid day.
"""
next = date + datetime.timedelta(days=1)
return _get_next_prev_month(self, next, is_previous=False, use_first_day=False)
|
def
get_previous_day(self, date):
DayMixin
¶
def
get_previous_day(self, date):
DayMixin
¶
Get the previous valid day.
109 110 111 112 113 114 | def get_previous_day(self, date):
"""
Get the previous valid day.
"""
prev = date - datetime.timedelta(days=1)
return _get_next_prev_month(self, prev, is_previous=True, use_first_day=False)
|