per page, with , order by , clip by
Results of 1 - 1 of about 1 for ArticleListView (0.000 sec.)
ジェネリック表示ビュー (Generic display view) 9414
ジェネリック表示ビュー (Generic display view) 以下の2つのクラスベースのジェネリックビューは、データを表示 (display) するために設計されています。多くのプロジェクトで、これらは最もよく使われるビューです。 DetailView class django.views.generic ... from django.utils import timezone from django.views.generic.list import ListView from articles.models import Article class ArticleListView ( ListView ): model = Article paginate_by = 100 # if pagination is desired def get_context_data ( self , ** kwargs ): cont ... ext [ "now" ] = timezone . now () return context 例 myapp/urls.py : from django.urls import path from article.views import ArticleListView urlpatterns = [ path ( "" , ArticleListView . as_view (), name = "article-list" ), ] 例 myapp/article_list.html : < h1 > A ...
https://man.mtool.work/django/6.1/ref/class-based-views/generic-display.html
PREV 1 NEXT