Generic date views
Generic date views
Date-based generic views, provided in django.views.generic.dates
, are views for displaying drilldown pages for date-based data.
Note
Some of the examples on this page assume that an Article
model has been defined as follows in myapp/models.py
:
from django.db import models from django.urls import reverse class Article(models.Model): title = models.CharField(max_length=200) pub_date = models.DateField() def get_absolute_url(self): return reverse('article-detail', kwargs={'pk': self.pk})