per page, with , order by , clip by
Results of 1 - 2 of about 2 for ArticleDetailView (0.001 sec.)
ジェネリック表示ビュー (Generic display view) 11228
ジェネリック表示ビュー (Generic display view) 以下の2つのクラスベースのジェネリックビューは、データを表示 (display) するために設計されています。多くのプロジェクトで、これらは最もよく使われるビューです。 DetailView class django.views.generic ... django.utils import timezone from django.views.generic.detail import DetailView from articles.models import Article class ArticleDetailView ( DetailView ): model = Article def get_context_data ( self , ** kwargs ): context = super () . get_context_data ( ** kwar ... ext [ "now" ] = timezone . now () return context 例 myapp/urls.py : from django.urls import path from article.views import ArticleDetailView urlpatterns = [ path ( "<slug:slug>/" , ArticleDetailView . as_view (), name = "article-detail" ), ] 例 myapp/article_deta ...
https://man.mtool.work/django/6.1/ref/class-based-views/generic-display.html
ベース・ビュー 7485
ベース・ビュー 以下の3つのクラスは、Django のビューの作成に必要な多くの機能を提供します。これらは Django ビューの 親の ビューとみなすことができ、それ自体で使うことも継承して使うこともできます。プロジェクトに必要な全ての機能を提供するわけでは ... urls import path from django.views.generic.base import RedirectView from article.views import ArticleCounterRedirectView , ArticleDetailView urlpatterns = [ path ( "counter/<int:pk>/" , ArticleCounterRedirectView . as_view (), name = "article-counter" , ), path ( ... "details/<int:pk>/" , ArticleDetailView . as_view (), name = "article-detail" ), path ( "go-to-django/" , RedirectView . as_view ( url = "https://www.djangoprojec ...
https://man.mtool.work/django/6.1/ref/class-based-views/base.html
PREV 1 NEXT