class MonthMixin [source]
A mixin that can be used to retrieve and provide parsing information for a month component of a date.
Methods and Attributes
-
month_format -
The
strftime()format to use when parsing the month. By default, this is'%b'.
-
month -
Optional The value for the month, as a string. By default, set to
None, which means the month will be determined using other means.
-
get_month_format()[source] -
Returns the
strftime()format to use when parsing the month. Returnsmonth_formatby default.
-
get_month()[source] -
Returns the month for which this view will display data, as a string. Tries the following sources, in order:
- The value of the
MonthMixin.monthattribute. - The value of the
monthargument captured in the URL pattern. - The value of the
monthGETquery argument.
Raises a 404 if no valid month specification can be found.
- The value of the
-
get_next_month(date)[source] -
Returns a date object containing the first day of the month after the date provided. This function can also return
Noneor raise anHttp404exception, depending on the values ofallow_emptyandallow_future.
-
get_previous_month(date)[source] -
Returns a date object containing the first day of the month before the date provided. This function can also return
Noneor raise anHttp404exception, depending on the values ofallow_emptyandallow_future.
Please login to continue.