{"title":"Date-based mixins","version":"1.11","locale":"es","docname":"ref/class-based-views/mixins-date-based","url":"/es/1.11/ref/class-based-views/mixins-date-based/","canonical":"https://djangodocs.dev/es/1.11/ref/class-based-views/mixins-date-based/","summary":"Nota All the date formatting attributes in these mixins use strftime() format characters. Do not try to use the format characters from the now template tag as they…","html":"<h1>Date-based mixins<a class=\"heading-anchor\" href=\"#date-based-mixins\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h1>\n<aside class=\"admonition admonition-note\" role=\"note\">\n<p class=\"admonition-title\">Nota</p>\n<p>All the date formatting attributes in these mixins use\n<a class=\"reference external\" href=\"https://docs.python.org/3/library/time.html#time.strftime\" title=\"(en Python versión 3.14)\"><code class=\"xref py py-func docutils literal notranslate\"><span class=\"pre\">strftime()</span></code></a> format characters. Do not try to use the format\ncharacters from the <a class=\"reference internal\" href=\"/es/1.11/ref/templates/builtins/#std-templatetag-now\"><code class=\"xref std std-ttag docutils literal notranslate\"><span class=\"pre\">now</span></code></a> template tag as they are not compatible.</p>\n</aside>\n<section id=\"yearmixin\">\n<h2><code class=\"docutils literal notranslate\"><span class=\"pre\">YearMixin</span></code><a class=\"heading-anchor\" href=\"#yearmixin\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<dl class=\"py class\">\n<dt class=\"sig sig-object py\" id=\"django.views.generic.dates.YearMixin\">\n<em class=\"property\"><span class=\"k\"><span class=\"pre\">class</span></span><span class=\"w\"> </span></em><span class=\"sig-name descname\"><span class=\"pre\">YearMixin</span></span><a class=\"heading-anchor\" href=\"#django.views.generic.dates.YearMixin\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd><p>A mixin that can be used to retrieve and provide parsing information for a\nyear component of a date.</p>\n<p><strong>Methods and Attributes</strong></p>\n<dl class=\"py attribute\">\n<dt class=\"sig sig-object py\" id=\"django.views.generic.dates.YearMixin.year_format\">\n<span class=\"sig-name descname\"><span class=\"pre\">year_format</span></span><a class=\"heading-anchor\" href=\"#django.views.generic.dates.YearMixin.year_format\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd><p>The <a class=\"reference external\" href=\"https://docs.python.org/3/library/time.html#time.strftime\" title=\"(en Python versión 3.14)\"><code class=\"xref py py-func docutils literal notranslate\"><span class=\"pre\">strftime()</span></code></a> format to use when parsing the year.\nBy default, this is <code class=\"docutils literal notranslate\"><span class=\"pre\">'%Y'</span></code>.</p>\n</dd></dl>\n\n<dl class=\"py attribute\">\n<dt class=\"sig sig-object py\" id=\"django.views.generic.dates.YearMixin.year\">\n<span class=\"sig-name descname\"><span class=\"pre\">year</span></span><a class=\"heading-anchor\" href=\"#django.views.generic.dates.YearMixin.year\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd><p><strong>Optional</strong> The value for the year, as a string. By default, set to\n<code class=\"docutils literal notranslate\"><span class=\"pre\">None</span></code>, which means the year will be determined using other means.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"django.views.generic.dates.YearMixin.get_year_format\">\n<span class=\"sig-name descname\"><span class=\"pre\">get_year_format</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"heading-anchor\" href=\"#django.views.generic.dates.YearMixin.get_year_format\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd><p>Returns the <a class=\"reference external\" href=\"https://docs.python.org/3/library/time.html#time.strftime\" title=\"(en Python versión 3.14)\"><code class=\"xref py py-func docutils literal notranslate\"><span class=\"pre\">strftime()</span></code></a> format to use when parsing the\nyear. Returns <a class=\"reference internal\" href=\"#django.views.generic.dates.YearMixin.year_format\" title=\"django.views.generic.dates.YearMixin.year_format\"><code class=\"xref py py-attr docutils literal notranslate\"><span class=\"pre\">year_format</span></code></a> by default.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"django.views.generic.dates.YearMixin.get_year\">\n<span class=\"sig-name descname\"><span class=\"pre\">get_year</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"heading-anchor\" href=\"#django.views.generic.dates.YearMixin.get_year\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd><p>Returns the year for which this view will display data, as a string.\nTries the following sources, in order:</p>\n<ul class=\"simple\">\n<li><p>The value of the <a class=\"reference internal\" href=\"#django.views.generic.dates.YearMixin.year\" title=\"django.views.generic.dates.YearMixin.year\"><code class=\"xref py py-attr docutils literal notranslate\"><span class=\"pre\">YearMixin.year</span></code></a> attribute.</p></li>\n<li><p>The value of the <code class=\"docutils literal notranslate\"><span class=\"pre\">year</span></code> argument captured in the URL pattern.</p></li>\n<li><p>The value of the <code class=\"docutils literal notranslate\"><span class=\"pre\">year</span></code> <code class=\"docutils literal notranslate\"><span class=\"pre\">GET</span></code> query argument.</p></li>\n</ul>\n<p>Raises a 404 if no valid year specification can be found.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"django.views.generic.dates.YearMixin.get_next_year\">\n<span class=\"sig-name descname\"><span class=\"pre\">get_next_year</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">date</span></span></em><span class=\"sig-paren\">)</span><a class=\"heading-anchor\" href=\"#django.views.generic.dates.YearMixin.get_next_year\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd><p>Returns a date object containing the first day of the year after the\ndate provided. This function can also return <code class=\"docutils literal notranslate\"><span class=\"pre\">None</span></code> or raise an\n<a class=\"reference internal\" href=\"/es/1.11/topics/http/views/#django.http.Http404\" title=\"django.http.Http404\"><code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">Http404</span></code></a> exception, depending on the values of\n<a class=\"reference internal\" href=\"#django.views.generic.dates.BaseDateListView.allow_empty\" title=\"django.views.generic.dates.BaseDateListView.allow_empty\"><code class=\"xref py py-attr docutils literal notranslate\"><span class=\"pre\">allow_empty</span></code></a> and\n<a class=\"reference internal\" href=\"#django.views.generic.dates.DateMixin.allow_future\" title=\"django.views.generic.dates.DateMixin.allow_future\"><code class=\"xref py py-attr docutils literal notranslate\"><span class=\"pre\">allow_future</span></code></a>.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"django.views.generic.dates.YearMixin.get_previous_year\">\n<span class=\"sig-name descname\"><span class=\"pre\">get_previous_year</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">date</span></span></em><span class=\"sig-paren\">)</span><a class=\"heading-anchor\" href=\"#django.views.generic.dates.YearMixin.get_previous_year\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd><p>Returns a date object containing the first day of the year before the\ndate provided. This function can also return <code class=\"docutils literal notranslate\"><span class=\"pre\">None</span></code> or raise an\n<a class=\"reference internal\" href=\"/es/1.11/topics/http/views/#django.http.Http404\" title=\"django.http.Http404\"><code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">Http404</span></code></a> exception, depending on the values of\n<a class=\"reference internal\" href=\"#django.views.generic.dates.BaseDateListView.allow_empty\" title=\"django.views.generic.dates.BaseDateListView.allow_empty\"><code class=\"xref py py-attr docutils literal notranslate\"><span class=\"pre\">allow_empty</span></code></a> and\n<a class=\"reference internal\" href=\"#django.views.generic.dates.DateMixin.allow_future\" title=\"django.views.generic.dates.DateMixin.allow_future\"><code class=\"xref py py-attr docutils literal notranslate\"><span class=\"pre\">allow_future</span></code></a>.</p>\n</dd></dl>\n\n</dd></dl>\n\n</section>\n<section id=\"monthmixin\">\n<h2><code class=\"docutils literal notranslate\"><span class=\"pre\">MonthMixin</span></code><a class=\"heading-anchor\" href=\"#monthmixin\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<dl class=\"py class\">\n<dt class=\"sig sig-object py\" id=\"django.views.generic.dates.MonthMixin\">\n<em class=\"property\"><span class=\"k\"><span class=\"pre\">class</span></span><span class=\"w\"> </span></em><span class=\"sig-name descname\"><span class=\"pre\">MonthMixin</span></span><a class=\"heading-anchor\" href=\"#django.views.generic.dates.MonthMixin\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd><p>A mixin that can be used to retrieve and provide parsing information for a\nmonth component of a date.</p>\n<p><strong>Methods and Attributes</strong></p>\n<dl class=\"py attribute\">\n<dt class=\"sig sig-object py\" id=\"django.views.generic.dates.MonthMixin.month_format\">\n<span class=\"sig-name descname\"><span class=\"pre\">month_format</span></span><a class=\"heading-anchor\" href=\"#django.views.generic.dates.MonthMixin.month_format\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd><p>The <a class=\"reference external\" href=\"https://docs.python.org/3/library/time.html#time.strftime\" title=\"(en Python versión 3.14)\"><code class=\"xref py py-func docutils literal notranslate\"><span class=\"pre\">strftime()</span></code></a> format to use when parsing the month. By\ndefault, this is <code class=\"docutils literal notranslate\"><span class=\"pre\">'%b'</span></code>.</p>\n</dd></dl>\n\n<dl class=\"py attribute\">\n<dt class=\"sig sig-object py\" id=\"django.views.generic.dates.MonthMixin.month\">\n<span class=\"sig-name descname\"><span class=\"pre\">month</span></span><a class=\"heading-anchor\" href=\"#django.views.generic.dates.MonthMixin.month\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd><p><strong>Optional</strong> The value for the month, as a string. By default, set to\n<code class=\"docutils literal notranslate\"><span class=\"pre\">None</span></code>, which means the month will be determined using other means.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"django.views.generic.dates.MonthMixin.get_month_format\">\n<span class=\"sig-name descname\"><span class=\"pre\">get_month_format</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"heading-anchor\" href=\"#django.views.generic.dates.MonthMixin.get_month_format\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd><p>Returns the <a class=\"reference external\" href=\"https://docs.python.org/3/library/time.html#time.strftime\" title=\"(en Python versión 3.14)\"><code class=\"xref py py-func docutils literal notranslate\"><span class=\"pre\">strftime()</span></code></a> format to use when parsing the\nmonth. Returns <a class=\"reference internal\" href=\"#django.views.generic.dates.MonthMixin.month_format\" title=\"django.views.generic.dates.MonthMixin.month_format\"><code class=\"xref py py-attr docutils literal notranslate\"><span class=\"pre\">month_format</span></code></a> by default.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"django.views.generic.dates.MonthMixin.get_month\">\n<span class=\"sig-name descname\"><span class=\"pre\">get_month</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"heading-anchor\" href=\"#django.views.generic.dates.MonthMixin.get_month\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd><p>Returns the month for which this view will display data, as a string.\nTries the following sources, in order:</p>\n<ul class=\"simple\">\n<li><p>The value of the <a class=\"reference internal\" href=\"#django.views.generic.dates.MonthMixin.month\" title=\"django.views.generic.dates.MonthMixin.month\"><code class=\"xref py py-attr docutils literal notranslate\"><span class=\"pre\">MonthMixin.month</span></code></a> attribute.</p></li>\n<li><p>The value of the <code class=\"docutils literal notranslate\"><span class=\"pre\">month</span></code> argument captured in the URL pattern.</p></li>\n<li><p>The value of the <code class=\"docutils literal notranslate\"><span class=\"pre\">month</span></code> <code class=\"docutils literal notranslate\"><span class=\"pre\">GET</span></code> query argument.</p></li>\n</ul>\n<p>Raises a 404 if no valid month specification can be found.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"django.views.generic.dates.MonthMixin.get_next_month\">\n<span class=\"sig-name descname\"><span class=\"pre\">get_next_month</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">date</span></span></em><span class=\"sig-paren\">)</span><a class=\"heading-anchor\" href=\"#django.views.generic.dates.MonthMixin.get_next_month\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd><p>Returns a date object containing the first day of the month after the\ndate provided. This function can also return <code class=\"docutils literal notranslate\"><span class=\"pre\">None</span></code> or raise an\n<a class=\"reference internal\" href=\"/es/1.11/topics/http/views/#django.http.Http404\" title=\"django.http.Http404\"><code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">Http404</span></code></a> exception, depending on the values of\n<a class=\"reference internal\" href=\"#django.views.generic.dates.BaseDateListView.allow_empty\" title=\"django.views.generic.dates.BaseDateListView.allow_empty\"><code class=\"xref py py-attr docutils literal notranslate\"><span class=\"pre\">allow_empty</span></code></a> and\n<a class=\"reference internal\" href=\"#django.views.generic.dates.DateMixin.allow_future\" title=\"django.views.generic.dates.DateMixin.allow_future\"><code class=\"xref py py-attr docutils literal notranslate\"><span class=\"pre\">allow_future</span></code></a>.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"django.views.generic.dates.MonthMixin.get_previous_month\">\n<span class=\"sig-name descname\"><span class=\"pre\">get_previous_month</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">date</span></span></em><span class=\"sig-paren\">)</span><a class=\"heading-anchor\" href=\"#django.views.generic.dates.MonthMixin.get_previous_month\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd><p>Returns a date object containing the first day of the month before the\ndate provided. This function can also return <code class=\"docutils literal notranslate\"><span class=\"pre\">None</span></code> or raise an\n<a class=\"reference internal\" href=\"/es/1.11/topics/http/views/#django.http.Http404\" title=\"django.http.Http404\"><code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">Http404</span></code></a> exception, depending on the values of\n<a class=\"reference internal\" href=\"#django.views.generic.dates.BaseDateListView.allow_empty\" title=\"django.views.generic.dates.BaseDateListView.allow_empty\"><code class=\"xref py py-attr docutils literal notranslate\"><span class=\"pre\">allow_empty</span></code></a> and\n<a class=\"reference internal\" href=\"#django.views.generic.dates.DateMixin.allow_future\" title=\"django.views.generic.dates.DateMixin.allow_future\"><code class=\"xref py py-attr docutils literal notranslate\"><span class=\"pre\">allow_future</span></code></a>.</p>\n</dd></dl>\n\n</dd></dl>\n\n</section>\n<section id=\"daymixin\">\n<h2><code class=\"docutils literal notranslate\"><span class=\"pre\">DayMixin</span></code><a class=\"heading-anchor\" href=\"#daymixin\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<dl class=\"py class\">\n<dt class=\"sig sig-object py\" id=\"django.views.generic.dates.DayMixin\">\n<em class=\"property\"><span class=\"k\"><span class=\"pre\">class</span></span><span class=\"w\"> </span></em><span class=\"sig-name descname\"><span class=\"pre\">DayMixin</span></span><a class=\"heading-anchor\" href=\"#django.views.generic.dates.DayMixin\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd><p>A mixin that can be used to retrieve and provide parsing information for a\nday component of a date.</p>\n<p><strong>Methods and Attributes</strong></p>\n<dl class=\"py attribute\">\n<dt class=\"sig sig-object py\" id=\"django.views.generic.dates.DayMixin.day_format\">\n<span class=\"sig-name descname\"><span class=\"pre\">day_format</span></span><a class=\"heading-anchor\" href=\"#django.views.generic.dates.DayMixin.day_format\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd><p>The <a class=\"reference external\" href=\"https://docs.python.org/3/library/time.html#time.strftime\" title=\"(en Python versión 3.14)\"><code class=\"xref py py-func docutils literal notranslate\"><span class=\"pre\">strftime()</span></code></a> format to use when parsing the day. By\ndefault, this is <code class=\"docutils literal notranslate\"><span class=\"pre\">'%d'</span></code>.</p>\n</dd></dl>\n\n<dl class=\"py attribute\">\n<dt class=\"sig sig-object py\" id=\"django.views.generic.dates.DayMixin.day\">\n<span class=\"sig-name descname\"><span class=\"pre\">day</span></span><a class=\"heading-anchor\" href=\"#django.views.generic.dates.DayMixin.day\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd><p><strong>Optional</strong> The value for the day, as a string. By default, set to\n<code class=\"docutils literal notranslate\"><span class=\"pre\">None</span></code>, which means the day will be determined using other means.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"django.views.generic.dates.DayMixin.get_day_format\">\n<span class=\"sig-name descname\"><span class=\"pre\">get_day_format</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"heading-anchor\" href=\"#django.views.generic.dates.DayMixin.get_day_format\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd><p>Returns the <a class=\"reference external\" href=\"https://docs.python.org/3/library/time.html#time.strftime\" title=\"(en Python versión 3.14)\"><code class=\"xref py py-func docutils literal notranslate\"><span class=\"pre\">strftime()</span></code></a> format to use when parsing the day.\nReturns <a class=\"reference internal\" href=\"#django.views.generic.dates.DayMixin.day_format\" title=\"django.views.generic.dates.DayMixin.day_format\"><code class=\"xref py py-attr docutils literal notranslate\"><span class=\"pre\">day_format</span></code></a> by default.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"django.views.generic.dates.DayMixin.get_day\">\n<span class=\"sig-name descname\"><span class=\"pre\">get_day</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"heading-anchor\" href=\"#django.views.generic.dates.DayMixin.get_day\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd><p>Returns the day for which this view will display data, as a string.\nTries the following sources, in order:</p>\n<ul class=\"simple\">\n<li><p>The value of the <a class=\"reference internal\" href=\"#django.views.generic.dates.DayMixin.day\" title=\"django.views.generic.dates.DayMixin.day\"><code class=\"xref py py-attr docutils literal notranslate\"><span class=\"pre\">DayMixin.day</span></code></a> attribute.</p></li>\n<li><p>The value of the <code class=\"docutils literal notranslate\"><span class=\"pre\">day</span></code> argument captured in the URL pattern.</p></li>\n<li><p>The value of the <code class=\"docutils literal notranslate\"><span class=\"pre\">day</span></code> <code class=\"docutils literal notranslate\"><span class=\"pre\">GET</span></code> query argument.</p></li>\n</ul>\n<p>Raises a 404 if no valid day specification can be found.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"django.views.generic.dates.DayMixin.get_next_day\">\n<span class=\"sig-name descname\"><span class=\"pre\">get_next_day</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">date</span></span></em><span class=\"sig-paren\">)</span><a class=\"heading-anchor\" href=\"#django.views.generic.dates.DayMixin.get_next_day\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd><p>Returns a date object containing the next valid day after the date\nprovided. This function can also return <code class=\"docutils literal notranslate\"><span class=\"pre\">None</span></code> or raise an\n<a class=\"reference internal\" href=\"/es/1.11/topics/http/views/#django.http.Http404\" title=\"django.http.Http404\"><code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">Http404</span></code></a> exception, depending on the values of\n<a class=\"reference internal\" href=\"#django.views.generic.dates.BaseDateListView.allow_empty\" title=\"django.views.generic.dates.BaseDateListView.allow_empty\"><code class=\"xref py py-attr docutils literal notranslate\"><span class=\"pre\">allow_empty</span></code></a> and\n<a class=\"reference internal\" href=\"#django.views.generic.dates.DateMixin.allow_future\" title=\"django.views.generic.dates.DateMixin.allow_future\"><code class=\"xref py py-attr docutils literal notranslate\"><span class=\"pre\">allow_future</span></code></a>.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"django.views.generic.dates.DayMixin.get_previous_day\">\n<span class=\"sig-name descname\"><span class=\"pre\">get_previous_day</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">date</span></span></em><span class=\"sig-paren\">)</span><a class=\"heading-anchor\" href=\"#django.views.generic.dates.DayMixin.get_previous_day\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd><p>Returns a date object containing the previous valid day. This function\ncan also return <code class=\"docutils literal notranslate\"><span class=\"pre\">None</span></code> or raise an <a class=\"reference internal\" href=\"/es/1.11/topics/http/views/#django.http.Http404\" title=\"django.http.Http404\"><code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">Http404</span></code></a>\nexception, depending on the values of\n<a class=\"reference internal\" href=\"#django.views.generic.dates.BaseDateListView.allow_empty\" title=\"django.views.generic.dates.BaseDateListView.allow_empty\"><code class=\"xref py py-attr docutils literal notranslate\"><span class=\"pre\">allow_empty</span></code></a> and\n<a class=\"reference internal\" href=\"#django.views.generic.dates.DateMixin.allow_future\" title=\"django.views.generic.dates.DateMixin.allow_future\"><code class=\"xref py py-attr docutils literal notranslate\"><span class=\"pre\">allow_future</span></code></a>.</p>\n</dd></dl>\n\n</dd></dl>\n\n</section>\n<section id=\"weekmixin\">\n<h2><code class=\"docutils literal notranslate\"><span class=\"pre\">WeekMixin</span></code><a class=\"heading-anchor\" href=\"#weekmixin\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<dl class=\"py class\">\n<dt class=\"sig sig-object py\" id=\"django.views.generic.dates.WeekMixin\">\n<em class=\"property\"><span class=\"k\"><span class=\"pre\">class</span></span><span class=\"w\"> </span></em><span class=\"sig-name descname\"><span class=\"pre\">WeekMixin</span></span><a class=\"heading-anchor\" href=\"#django.views.generic.dates.WeekMixin\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd><p>A mixin that can be used to retrieve and provide parsing information for a\nweek component of a date.</p>\n<p><strong>Methods and Attributes</strong></p>\n<dl class=\"py attribute\">\n<dt class=\"sig sig-object py\" id=\"django.views.generic.dates.WeekMixin.week_format\">\n<span class=\"sig-name descname\"><span class=\"pre\">week_format</span></span><a class=\"heading-anchor\" href=\"#django.views.generic.dates.WeekMixin.week_format\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd><p>The <a class=\"reference external\" href=\"https://docs.python.org/3/library/time.html#time.strftime\" title=\"(en Python versión 3.14)\"><code class=\"xref py py-func docutils literal notranslate\"><span class=\"pre\">strftime()</span></code></a> format to use when parsing the week. By\ndefault, this is <code class=\"docutils literal notranslate\"><span class=\"pre\">'%U'</span></code>, which means the week starts on Sunday. Set\nit to <code class=\"docutils literal notranslate\"><span class=\"pre\">'%W'</span></code> if your week starts on Monday.</p>\n</dd></dl>\n\n<dl class=\"py attribute\">\n<dt class=\"sig sig-object py\" id=\"django.views.generic.dates.WeekMixin.week\">\n<span class=\"sig-name descname\"><span class=\"pre\">week</span></span><a class=\"heading-anchor\" href=\"#django.views.generic.dates.WeekMixin.week\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd><p><strong>Optional</strong> The value for the week, as a string. By default, set to\n<code class=\"docutils literal notranslate\"><span class=\"pre\">None</span></code>, which means the week will be determined using other means.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"django.views.generic.dates.WeekMixin.get_week_format\">\n<span class=\"sig-name descname\"><span class=\"pre\">get_week_format</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"heading-anchor\" href=\"#django.views.generic.dates.WeekMixin.get_week_format\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd><p>Returns the <a class=\"reference external\" href=\"https://docs.python.org/3/library/time.html#time.strftime\" title=\"(en Python versión 3.14)\"><code class=\"xref py py-func docutils literal notranslate\"><span class=\"pre\">strftime()</span></code></a> format to use when parsing the\nweek. Returns <a class=\"reference internal\" href=\"#django.views.generic.dates.WeekMixin.week_format\" title=\"django.views.generic.dates.WeekMixin.week_format\"><code class=\"xref py py-attr docutils literal notranslate\"><span class=\"pre\">week_format</span></code></a> by default.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"django.views.generic.dates.WeekMixin.get_week\">\n<span class=\"sig-name descname\"><span class=\"pre\">get_week</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"heading-anchor\" href=\"#django.views.generic.dates.WeekMixin.get_week\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd><p>Returns the week for which this view will display data, as a string.\nTries the following sources, in order:</p>\n<ul class=\"simple\">\n<li><p>The value of the <a class=\"reference internal\" href=\"#django.views.generic.dates.WeekMixin.week\" title=\"django.views.generic.dates.WeekMixin.week\"><code class=\"xref py py-attr docutils literal notranslate\"><span class=\"pre\">WeekMixin.week</span></code></a> attribute.</p></li>\n<li><p>The value of the <code class=\"docutils literal notranslate\"><span class=\"pre\">week</span></code> argument captured in the URL pattern</p></li>\n<li><p>The value of the <code class=\"docutils literal notranslate\"><span class=\"pre\">week</span></code> <code class=\"docutils literal notranslate\"><span class=\"pre\">GET</span></code> query argument.</p></li>\n</ul>\n<p>Raises a 404 if no valid week specification can be found.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"django.views.generic.dates.WeekMixin.get_next_week\">\n<span class=\"sig-name descname\"><span class=\"pre\">get_next_week</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">date</span></span></em><span class=\"sig-paren\">)</span><a class=\"heading-anchor\" href=\"#django.views.generic.dates.WeekMixin.get_next_week\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd><p>Returns a date object containing the first day of the week after the\ndate provided. This function can also return <code class=\"docutils literal notranslate\"><span class=\"pre\">None</span></code> or raise an\n<a class=\"reference internal\" href=\"/es/1.11/topics/http/views/#django.http.Http404\" title=\"django.http.Http404\"><code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">Http404</span></code></a> exception, depending on the values of\n<a class=\"reference internal\" href=\"#django.views.generic.dates.BaseDateListView.allow_empty\" title=\"django.views.generic.dates.BaseDateListView.allow_empty\"><code class=\"xref py py-attr docutils literal notranslate\"><span class=\"pre\">allow_empty</span></code></a> and\n<a class=\"reference internal\" href=\"#django.views.generic.dates.DateMixin.allow_future\" title=\"django.views.generic.dates.DateMixin.allow_future\"><code class=\"xref py py-attr docutils literal notranslate\"><span class=\"pre\">allow_future</span></code></a>.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"django.views.generic.dates.WeekMixin.get_prev_week\">\n<span class=\"sig-name descname\"><span class=\"pre\">get_prev_week</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">date</span></span></em><span class=\"sig-paren\">)</span><a class=\"heading-anchor\" href=\"#django.views.generic.dates.WeekMixin.get_prev_week\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd><p>Returns a date object containing the first day of the week before the\ndate provided. This function can also return <code class=\"docutils literal notranslate\"><span class=\"pre\">None</span></code> or raise an\n<a class=\"reference internal\" href=\"/es/1.11/topics/http/views/#django.http.Http404\" title=\"django.http.Http404\"><code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">Http404</span></code></a> exception, depending on the values of\n<a class=\"reference internal\" href=\"#django.views.generic.dates.BaseDateListView.allow_empty\" title=\"django.views.generic.dates.BaseDateListView.allow_empty\"><code class=\"xref py py-attr docutils literal notranslate\"><span class=\"pre\">allow_empty</span></code></a> and\n<a class=\"reference internal\" href=\"#django.views.generic.dates.DateMixin.allow_future\" title=\"django.views.generic.dates.DateMixin.allow_future\"><code class=\"xref py py-attr docutils literal notranslate\"><span class=\"pre\">allow_future</span></code></a>.</p>\n</dd></dl>\n\n</dd></dl>\n\n</section>\n<section id=\"datemixin\">\n<h2><code class=\"docutils literal notranslate\"><span class=\"pre\">DateMixin</span></code><a class=\"heading-anchor\" href=\"#datemixin\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<dl class=\"py class\">\n<dt class=\"sig sig-object py\" id=\"django.views.generic.dates.DateMixin\">\n<em class=\"property\"><span class=\"k\"><span class=\"pre\">class</span></span><span class=\"w\"> </span></em><span class=\"sig-name descname\"><span class=\"pre\">DateMixin</span></span><a class=\"heading-anchor\" href=\"#django.views.generic.dates.DateMixin\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd><p>A mixin class providing common behavior for all date-based views.</p>\n<p><strong>Methods and Attributes</strong></p>\n<dl class=\"py attribute\">\n<dt class=\"sig sig-object py\" id=\"django.views.generic.dates.DateMixin.date_field\">\n<span class=\"sig-name descname\"><span class=\"pre\">date_field</span></span><a class=\"heading-anchor\" href=\"#django.views.generic.dates.DateMixin.date_field\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd><p>The name of the <code class=\"docutils literal notranslate\"><span class=\"pre\">DateField</span></code> or <code class=\"docutils literal notranslate\"><span class=\"pre\">DateTimeField</span></code> in the\n<code class=\"docutils literal notranslate\"><span class=\"pre\">QuerySet</span></code>’s model that the date-based archive should use to\ndetermine the list of objects to display on the page.</p>\n<p>When <a class=\"reference internal\" href=\"/es/1.11/topics/i18n/timezones/\"><span class=\"doc\">time zone support</span></a> is enabled and\n<code class=\"docutils literal notranslate\"><span class=\"pre\">date_field</span></code> is a <code class=\"docutils literal notranslate\"><span class=\"pre\">DateTimeField</span></code>, dates are assumed to be in the\ncurrent time zone. Otherwise, the queryset could include objects from\nthe previous or the next day in the end user’s time zone.</p>\n<aside class=\"admonition admonition-warning\" role=\"note\">\n<p class=\"admonition-title\">Advertencia</p>\n<p>In this situation, if you have implemented per-user time zone\nselection, the same URL may show a different set of objects,\ndepending on the end user’s time zone. To avoid this, you should\nuse a <code class=\"docutils literal notranslate\"><span class=\"pre\">DateField</span></code> as the <code class=\"docutils literal notranslate\"><span class=\"pre\">date_field</span></code> attribute.</p>\n</aside>\n</dd></dl>\n\n<dl class=\"py attribute\">\n<dt class=\"sig sig-object py\" id=\"django.views.generic.dates.DateMixin.allow_future\">\n<span class=\"sig-name descname\"><span class=\"pre\">allow_future</span></span><a class=\"heading-anchor\" href=\"#django.views.generic.dates.DateMixin.allow_future\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd><p>A boolean specifying whether to include «future» objects on this page,\nwhere «future» means objects in which the field specified in\n<code class=\"docutils literal notranslate\"><span class=\"pre\">date_field</span></code> is greater than the current date/time. By default, this\nis <code class=\"docutils literal notranslate\"><span class=\"pre\">False</span></code>.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"django.views.generic.dates.DateMixin.get_date_field\">\n<span class=\"sig-name descname\"><span class=\"pre\">get_date_field</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"heading-anchor\" href=\"#django.views.generic.dates.DateMixin.get_date_field\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd><p>Returns the name of the field that contains the date data that this\nview will operate on. Returns <a class=\"reference internal\" href=\"#django.views.generic.dates.DateMixin.date_field\" title=\"django.views.generic.dates.DateMixin.date_field\"><code class=\"xref py py-attr docutils literal notranslate\"><span class=\"pre\">date_field</span></code></a> by default.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"django.views.generic.dates.DateMixin.get_allow_future\">\n<span class=\"sig-name descname\"><span class=\"pre\">get_allow_future</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"heading-anchor\" href=\"#django.views.generic.dates.DateMixin.get_allow_future\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd><p>Determine whether to include «future» objects on this page, where\n«future» means objects in which the field specified in <code class=\"docutils literal notranslate\"><span class=\"pre\">date_field</span></code>\nis greater than the current date/time. Returns\n<a class=\"reference internal\" href=\"#django.views.generic.dates.DateMixin.allow_future\" title=\"django.views.generic.dates.DateMixin.allow_future\"><code class=\"xref py py-attr docutils literal notranslate\"><span class=\"pre\">allow_future</span></code></a> by default.</p>\n</dd></dl>\n\n</dd></dl>\n\n</section>\n<section id=\"basedatelistview\">\n<h2><code class=\"docutils literal notranslate\"><span class=\"pre\">BaseDateListView</span></code><a class=\"heading-anchor\" href=\"#basedatelistview\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<dl class=\"py class\">\n<dt class=\"sig sig-object py\" id=\"django.views.generic.dates.BaseDateListView\">\n<em class=\"property\"><span class=\"k\"><span class=\"pre\">class</span></span><span class=\"w\"> </span></em><span class=\"sig-name descname\"><span class=\"pre\">BaseDateListView</span></span><a class=\"heading-anchor\" href=\"#django.views.generic.dates.BaseDateListView\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd><p>A base class that provides common behavior for all date-based views. There\nwon’t normally be a reason to instantiate\n<a class=\"reference internal\" href=\"#django.views.generic.dates.BaseDateListView\" title=\"django.views.generic.dates.BaseDateListView\"><code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">BaseDateListView</span></code></a>; instantiate one of\nthe subclasses instead.</p>\n<p>While this view (and its subclasses) are executing, <code class=\"docutils literal notranslate\"><span class=\"pre\">self.object_list</span></code>\nwill contain the list of objects that the view is operating upon, and\n<code class=\"docutils literal notranslate\"><span class=\"pre\">self.date_list</span></code> will contain the list of dates for which data is\navailable.</p>\n<p><strong>Mixins</strong></p>\n<ul class=\"simple\">\n<li><p><a class=\"reference internal\" href=\"#django.views.generic.dates.DateMixin\" title=\"django.views.generic.dates.DateMixin\"><code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">DateMixin</span></code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"/es/1.11/ref/class-based-views/mixins-multiple-object/#django.views.generic.list.MultipleObjectMixin\" title=\"django.views.generic.list.MultipleObjectMixin\"><code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">MultipleObjectMixin</span></code></a></p></li>\n</ul>\n<p><strong>Methods and Attributes</strong></p>\n<dl class=\"py attribute\">\n<dt class=\"sig sig-object py\" id=\"django.views.generic.dates.BaseDateListView.allow_empty\">\n<span class=\"sig-name descname\"><span class=\"pre\">allow_empty</span></span><a class=\"heading-anchor\" href=\"#django.views.generic.dates.BaseDateListView.allow_empty\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd><p>A boolean specifying whether to display the page if no objects are\navailable. If this is <code class=\"docutils literal notranslate\"><span class=\"pre\">True</span></code> and no objects are available, the view\nwill display an empty page instead of raising a 404.</p>\n<p>This is identical to\n<a class=\"reference internal\" href=\"/es/1.11/ref/class-based-views/mixins-multiple-object/#django.views.generic.list.MultipleObjectMixin.allow_empty\" title=\"django.views.generic.list.MultipleObjectMixin.allow_empty\"><code class=\"xref py py-attr docutils literal notranslate\"><span class=\"pre\">django.views.generic.list.MultipleObjectMixin.allow_empty</span></code></a>,\nexcept for the default value, which is <code class=\"docutils literal notranslate\"><span class=\"pre\">False</span></code>.</p>\n</dd></dl>\n\n<dl class=\"py attribute\">\n<dt class=\"sig sig-object py\" id=\"django.views.generic.dates.BaseDateListView.date_list_period\">\n<span class=\"sig-name descname\"><span class=\"pre\">date_list_period</span></span><a class=\"heading-anchor\" href=\"#django.views.generic.dates.BaseDateListView.date_list_period\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd><p><strong>Optional</strong> A string defining the aggregation period for\n<code class=\"docutils literal notranslate\"><span class=\"pre\">date_list</span></code>. It must be one of <code class=\"docutils literal notranslate\"><span class=\"pre\">'year'</span></code> (default), <code class=\"docutils literal notranslate\"><span class=\"pre\">'month'</span></code>, or\n<code class=\"docutils literal notranslate\"><span class=\"pre\">'day'</span></code>.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"django.views.generic.dates.BaseDateListView.get_dated_items\">\n<span class=\"sig-name descname\"><span class=\"pre\">get_dated_items</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"heading-anchor\" href=\"#django.views.generic.dates.BaseDateListView.get_dated_items\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd><p>Returns a 3-tuple containing (<code class=\"docutils literal notranslate\"><span class=\"pre\">date_list</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">object_list</span></code>,\n<code class=\"docutils literal notranslate\"><span class=\"pre\">extra_context</span></code>).</p>\n<p><code class=\"docutils literal notranslate\"><span class=\"pre\">date_list</span></code> is the list of dates for which data is available.\n<code class=\"docutils literal notranslate\"><span class=\"pre\">object_list</span></code> is the list of objects. <code class=\"docutils literal notranslate\"><span class=\"pre\">extra_context</span></code> is a\ndictionary of context data that will be added to any context data\nprovided by the\n<a class=\"reference internal\" href=\"/es/1.11/ref/class-based-views/mixins-multiple-object/#django.views.generic.list.MultipleObjectMixin\" title=\"django.views.generic.list.MultipleObjectMixin\"><code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">MultipleObjectMixin</span></code></a>.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"django.views.generic.dates.BaseDateListView.get_dated_queryset\">\n<span class=\"sig-name descname\"><span class=\"pre\">get_dated_queryset</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\"><span class=\"pre\">**</span></span><span class=\"n\"><span class=\"pre\">lookup</span></span></em><span class=\"sig-paren\">)</span><a class=\"heading-anchor\" href=\"#django.views.generic.dates.BaseDateListView.get_dated_queryset\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd><p>Returns a queryset, filtered using the query arguments defined by\n<code class=\"docutils literal notranslate\"><span class=\"pre\">lookup</span></code>. Enforces any restrictions on the queryset, such as\n<code class=\"docutils literal notranslate\"><span class=\"pre\">allow_empty</span></code> and <code class=\"docutils literal notranslate\"><span class=\"pre\">allow_future</span></code>.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"django.views.generic.dates.BaseDateListView.get_date_list_period\">\n<span class=\"sig-name descname\"><span class=\"pre\">get_date_list_period</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"heading-anchor\" href=\"#django.views.generic.dates.BaseDateListView.get_date_list_period\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd><p>Returns the aggregation period for <code class=\"docutils literal notranslate\"><span class=\"pre\">date_list</span></code>. Returns\n<a class=\"reference internal\" href=\"#django.views.generic.dates.BaseDateListView.date_list_period\" title=\"django.views.generic.dates.BaseDateListView.date_list_period\"><code class=\"xref py py-attr docutils literal notranslate\"><span class=\"pre\">date_list_period</span></code></a> by default.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"django.views.generic.dates.BaseDateListView.get_date_list\">\n<span class=\"sig-name descname\"><span class=\"pre\">get_date_list</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">queryset</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">date_type</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">None</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">ordering</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">'ASC'</span></span></em><span class=\"sig-paren\">)</span><a class=\"heading-anchor\" href=\"#django.views.generic.dates.BaseDateListView.get_date_list\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd><p>Returns the list of dates of type <code class=\"docutils literal notranslate\"><span class=\"pre\">date_type</span></code> for which <code class=\"docutils literal notranslate\"><span class=\"pre\">queryset</span></code>\ncontains entries. For example, <code class=\"docutils literal notranslate\"><span class=\"pre\">get_date_list(qs,</span> <span class=\"pre\">'year')</span></code> will\nreturn the list of years for which <code class=\"docutils literal notranslate\"><span class=\"pre\">qs</span></code> has entries. If\n<code class=\"docutils literal notranslate\"><span class=\"pre\">date_type</span></code> isn’t provided, the result of\n<a class=\"reference internal\" href=\"#django.views.generic.dates.BaseDateListView.get_date_list_period\" title=\"django.views.generic.dates.BaseDateListView.get_date_list_period\"><code class=\"xref py py-meth docutils literal notranslate\"><span class=\"pre\">get_date_list_period()</span></code></a> is used. <code class=\"docutils literal notranslate\"><span class=\"pre\">date_type</span></code>\nand <code class=\"docutils literal notranslate\"><span class=\"pre\">ordering</span></code> are simply passed to\n<a class=\"reference internal\" href=\"/es/1.11/ref/models/querysets/#django.db.models.query.QuerySet.dates\" title=\"django.db.models.query.QuerySet.dates\"><code class=\"xref py py-meth docutils literal notranslate\"><span class=\"pre\">QuerySet.dates()</span></code></a>.</p>\n</dd></dl>\n\n</dd></dl>\n\n</section>","rootId":"date-based-mixins","toc":[{"title":"YearMixin","anchor":"yearmixin","children":[]},{"title":"MonthMixin","anchor":"monthmixin","children":[]},{"title":"DayMixin","anchor":"daymixin","children":[]},{"title":"WeekMixin","anchor":"weekmixin","children":[]},{"title":"DateMixin","anchor":"datemixin","children":[]},{"title":"BaseDateListView","anchor":"basedatelistview","children":[]}],"breadcrumbs":[{"docname":"ref/index","title":"API Reference","url":"/es/1.11/ref/"},{"docname":"ref/class-based-views/index","title":"Built-in class-based views API","url":"/es/1.11/ref/class-based-views/"},{"docname":"ref/class-based-views/mixins","title":"Class-based views mixins","url":"/es/1.11/ref/class-based-views/mixins/"}],"prev":{"docname":"ref/class-based-views/mixins-editing","title":"Editing mixins","url":"/es/1.11/ref/class-based-views/mixins-editing/"},"next":{"docname":"ref/class-based-views/flattened-index","title":"Class-based generic views - flattened index","url":"/es/1.11/ref/class-based-views/flattened-index/"},"formats":{"html":"/es/1.11/ref/class-based-views/mixins-date-based/","markdown":"/es/1.11/ref/class-based-views/mixins-date-based.md","json":"/es/1.11/ref/class-based-views/mixins-date-based.json"},"source":"https://github.com/django/django/blob/stable/1.11.x/docs/ref/class-based-views/mixins-date-based.txt","official":"https://docs.djangoproject.com/es/1.11/ref/class-based-views/mixins-date-based/","inVersions":["6.1","6.0","5.2","5.1","5.0","4.2","4.1","4.0","3.2","3.1","3.0","2.2","2.1","2.0","1.11","1.10","1.9"],"inLocales":["en","fr","ja","id","pt-br","ko","es","el","pl"]}