-
顯示
today
的所有對象的日存檔頁麵。這與django.views.generic.dates.DayArchiveView
year
/month
/day
參數。祖先 (MRO)
django.views.generic.list.MultipleObjectTemplateResponseMixin
django.views.generic.base.TemplateResponseMixin
django.views.generic.dates.BaseTodayArchiveView
django.views.generic.dates.BaseDayArchiveView
django.views.generic.dates.YearMixin
django.views.generic.dates.MonthMixin
django.views.generic.dates.DayMixin
django.views.generic.dates.BaseDateListView
- MultipleObjectMixin
django.views.generic.dates.DateMixin
- View
注意
- 使用
_archive_today
的默認template_name_suffix
。
示例 myapp/views.py:
from django.views.generic.dates import TodayArchiveView from myapp.models import Article class ArticleTodayArchiveView(TodayArchiveView): queryset = Article.objects.all() date_field = "pub_date" allow_future = True
示例 myapp/urls.py:
from django.urls import path from myapp.views import ArticleTodayArchiveView urlpatterns = [ path('today/', ArticleTodayArchiveView.as_view(), name="archive_today"), ]
TodayArchiveView
的示例模板在哪裏?默認情況下,此視圖使用與
DayArchiveView
template_name
屬性設置為新模板的名稱。
本文介紹 django.views.generic.dates.TodayArchiveView
的用法。
聲明
class TodayArchiveView
相關用法
- Python Thread join()用法及代碼示例
- Python Tensorflow asin()用法及代碼示例
- Python Django TransactionNow用法及代碼示例
- Python Thread run()用法及代碼示例
- Python TextBlob.correct()用法及代碼示例
- Python Tuple len()用法及代碼示例
- Python Tensorflow math.accumulate_n()用法及代碼示例
- Python Tensorflow cosh()用法及代碼示例
- Python Django TransactionTestCase.reset_sequences用法及代碼示例
- Python Tuple min()用法及代碼示例
- Python Thread setName()用法及代碼示例
- Python TextCalendar prmonth()用法及代碼示例
- Python Tensorflow sin()用法及代碼示例
- Python Tuples轉Dictionary用法及代碼示例
- Python Django TestCase.setUpTestData用法及代碼示例
- Python Tensorflow acos()用法及代碼示例
- Python Tuple轉integer用法及代碼示例
- Python Django TransactionTestCase.assertNumQueries用法及代碼示例
- Python Tableau TableauAuth用法及代碼示例
- Python Tensorflow asinh()用法及代碼示例
- Python Tensorflow nn.softplus()用法及代碼示例
- Python Tensorflow exp()用法及代碼示例
- Python Tensorflow logical_and()用法及代碼示例
- Python Django TestCase.captureOnCommitCallbacks用法及代碼示例
- Python Tensorflow logical_or()用法及代碼示例
注:本文由純淨天空篩選整理自djangoproject.com大神的英文原創作品 django.views.generic.dates.TodayArchiveView。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。