MCPcopy
hub / github.com/django/django / get_year

Method get_year

django/views/generic/dates.py:34–45  ·  view source on GitHub ↗

Return the year for which this view should display data.

(self)

Source from the content-addressed store, hash-verified

32 return self.year_format
33
34 def get_year(self):
35 """Return the year for which this view should display data."""
36 year = self.year
37 if year is None:
38 try:
39 year = self.kwargs["year"]
40 except KeyError:
41 try:
42 year = self.request.GET["year"]
43 except KeyError:
44 raise Http404(_("No year specified"))
45 return year
46
47 def get_next_year(self, date):
48 """Get the next valid year."""

Callers 5

get_dated_itemsMethod · 0.80
get_dated_itemsMethod · 0.80
get_dated_itemsMethod · 0.80
get_dated_itemsMethod · 0.80
get_objectMethod · 0.80

Calls 1

Http404Class · 0.90

Tested by

no test coverage detected