class WeekMixin
[source]
A mixin that can be used to retrieve and provide parsing information for a week component of a date.
Methods and Attributes
-
week_format
-
The
strftime()
format to use when parsing the week. By default, this is'%U'
, which means the week starts on Sunday. Set it to'%W'
if your week starts on Monday.
-
week
-
Optional The value for the week, as a string. By default, set to
None
, which means the week will be determined using other means.
-
get_week_format()
[source] -
Returns the
strftime()
format to use when parsing the week. Returnsweek_format
by default.
-
get_week()
[source] -
Returns the week for which this view will display data, as a string. Tries the following sources, in order:
- The value of the
WeekMixin.week
attribute. - The value of the
week
argument captured in the URL pattern - The value of the
week
GET
query argument.
Raises a 404 if no valid week specification can be found.
- The value of the
-
get_next_week(date)
[source] -
Returns a date object containing the first day of the week after the date provided. This function can also return
None
or raise anHttp404
exception, depending on the values ofallow_empty
andallow_future
.
-
get_prev_week(date)
-
Returns a date object containing the first day of the week before the date provided. This function can also return
None
or raise anHttp404
exception, depending on the values ofallow_empty
andallow_future
.
Please login to continue.