views.generic.detail.SingleObjectMixin.context_object_name

context_object_name Designates the name of the variable to use in the context.

views.generic.dates.YearMixin.year_format

year_format The strftime() format to use when parsing the year. By default, this is '%Y'.

views.generic.detail.SingleObjectMixin

class django.views.generic.detail.SingleObjectMixin Provides a mechanism for looking up an object associated with the current HTTP request. Methods and Attributes model The model that this view will display data for. Specifying model = Foo is effectively the same as specifying queryset = Foo.objects.all(), where objects stands for Foo’s default manager. queryset A QuerySet that represents the objects. If provided, the value of queryset supersedes the value provided for model. Warni

views.generic.detail.DetailView

class django.views.generic.detail.DetailView While this view is executing, self.object will contain the object that the view is operating upon. Ancestors (MRO) This view inherits methods and attributes from the following views: django.views.generic.detail.SingleObjectTemplateResponseMixin django.views.generic.base.TemplateResponseMixin django.views.generic.detail.BaseDetailView django.views.generic.detail.SingleObjectMixin django.views.generic.base.View Method Flowchart dispatch() http_met

views.generic.dates.YearMixin.year

year Optional The value for the year, as a string. By default, set to None, which means the year will be determined using other means.

views.generic.dates.YearMixin.get_year()

get_year() [source] Returns the year for which this view will display data, as a string. Tries the following sources, in order: The value of the YearMixin.year attribute. The value of the year argument captured in the URL pattern. The value of the year GET query argument. Raises a 404 if no valid year specification can be found.

views.generic.dates.YearArchiveView.make_object_list

make_object_list A boolean specifying whether to retrieve the full list of objects for this year and pass those to the template. If True, the list of objects will be made available to the context. If False, the None queryset will be used as the object list. By default, this is False.

views.generic.dates.YearMixin

class YearMixin [source] A mixin that can be used to retrieve and provide parsing information for a year component of a date. Methods and Attributes year_format The strftime() format to use when parsing the year. By default, this is '%Y'. year Optional The value for the year, as a string. By default, set to None, which means the year will be determined using other means. get_year_format() [source] Returns the strftime() format to use when parsing the year. Returns year_format

views.generic.dates.YearMixin.get_previous_year()

get_previous_year(date) [source] Returns a date object containing the first day of the year before the date provided. This function can also return None or raise an Http404 exception, depending on the values of allow_empty and allow_future.

views.generic.dates.YearMixin.get_year_format()

get_year_format() [source] Returns the strftime() format to use when parsing the year. Returns year_format by default.