per page, with , order by , clip by
Results of 1 - 10 of about 56 for article (0.003 sec.)
多対多 (many-to-many) 関係 — Django 6.1 ドキュメント 11566
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » 多対多 (many-to-many) 関係 ¶ 多対多の関係を定義するには、 ManyToManyField を使用します。 この例では、一つの Article は複数の Publication オブジェクト ... に掲載することができ、一つの Publication は複数の Article オブジェクトを持ちます: from django.db import models class Publication ( models . Model ): title = models . CharField ( ma ... x_length = 30 ) class Meta : ordering = [ "title" ] def __str__ ( self ): return self . title class Article ( models . Model ): headline = models . CharField ( max_length = 100 ) publications = models . ManyToManyField ( Publicati ... Publication ( title = "Science News" ) >>> p2 . save () >>> p3 = Publication ( title = "Science Weekly" ) >>> p3 . save () Article を一つ作ります: >>> a1 = Article ( headline = "Django lets you build web apps easily" ) 保存するまでは Publication と関連付 ...
https://man.mtool.work/django/6.1/topics/db/examples/many_to_many.html
多対多 (many-to-many) 関係 — Django 6.1 ドキュメント 11566
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » 多対多 (many-to-many) 関係 ¶ 多対多の関係を定義するには、 ManyToManyField を使用します。 この例では、一つの Article は複数の Publication オブジェクト ... に掲載することができ、一つの Publication は複数の Article オブジェクトを持ちます: from django.db import models class Publication ( models . Model ): title = models . CharField ( ma ... x_length = 30 ) class Meta : ordering = [ "title" ] def __str__ ( self ): return self . title class Article ( models . Model ): headline = models . CharField ( max_length = 100 ) publications = models . ManyToManyField ( Publicati ... Publication ( title = "Science News" ) >>> p2 . save () >>> p3 = Publication ( title = "Science Weekly" ) >>> p3 . save () Article を一つ作ります: >>> a1 = Article ( headline = "Django lets you build web apps easily" ) 保存するまでは Publication と関連付 ...
https://man.mtool.work/django/6.1/topics/db/examples/many_to_many.html
多対一 (many-to-one) 関係 — Django 6.1 ドキュメント 11507
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » 多対一 (many-to-one) 関係 ¶ 多対一のリレーションシップを定義するには ForeignKey を使います。 この例では、 Reporter は複数の Article オブジェクトと関 ... 連付けることができますが、 Article は一つの Reporter オブジェクトしか持つことができません: from django.db import models class Reporter ( models . Model ): fi ... = 30 ) email = models . EmailField () def __str__ ( self ): return f " { self . first_name } { self . last_name } " class Article ( models . Model ): headline = models . CharField ( max_length = 100 ) pub_date = models . DateField () reporter = models ... r . save () >>> r2 = Reporter ( first_name = "Paul" , last_name = "Jones" , email = "paul@example.com" ) >>> r2 . save () Article を作成する: >>> from datetime import date >>> a = Article ( id = None , headline = "This is a test" , pub_date = date ( 20 ...
https://man.mtool.work/django/6.1/topics/db/examples/many_to_one.html
多対一 (many-to-one) 関係 — Django 6.1 ドキュメント 11477
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » 多対一 (many-to-one) 関係 ¶ 多対一のリレーションシップを定義するには ForeignKey を使います。 この例では、 Reporter は複数の Article オブジェクトと関 ... 連付けることができますが、 Article は一つの Reporter オブジェクトしか持つことができません: from django.db import models class Reporter ( models . Model ): fi ... = 30 ) email = models . EmailField () def __str__ ( self ): return f " { self . first_name } { self . last_name } " class Article ( models . Model ): headline = models . CharField ( max_length = 100 ) pub_date = models . DateField () reporter = models ... r . save () >>> r2 = Reporter ( first_name = "Paul" , last_name = "Jones" , email = "paul@example.com" ) >>> r2 . save () Article を作成する: >>> from datetime import date >>> a = Article ( id = None , headline = "This is a test" , pub_date = date ( 20 ...
https://man.mtool.work/django/6.1/topics/db/examples/many_to_one.html
ジェネリック日付ビュー — Django 6.1 ドキュメント 9812
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » ジェネリック日付ビュー ¶ 日付ベースのジェネリックビュー ( django.views.generic.dates 内で提供されています) は、日付ベースのデータのために、ドリルダウ ... ンページを描画するためのビューです。 注釈 このページの例のいくつかは、 myapp/models.py 内で下記の通り Article モデルが定義されていると仮定します: from django.db import models from django.urls import reverse class Article ( models . ... models . CharField ( max_length = 200 ) pub_date = models . DateField () def get_absolute_url ( self ): return reverse ( "article-detail" , kwargs = { "pk" : self . pk }) ArchiveIndexView ¶ class ArchiveIndexView [ソース] ¶ "最新の"オブジェクトを、日付 ... pp/urls.py : from django.urls import path from django.views.generic.dates import ArchiveIndexView from myapp.models import Article urlpatterns = [ path ( "archive/" , ArchiveIndexView . as_view ( model = Article , date_field = "pub_date" ), name = "arti ...
https://man.mtool.work/django/6.1/ref/class-based-views/generic-date-based.html
ジェネリック日付ビュー — Django 6.1 ドキュメント 9783
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » ジェネリック日付ビュー ¶ 日付ベースのジェネリックビュー ( django.views.generic.dates 内で提供されています) は、日付ベースのデータのために、ドリルダウ ... ンページを描画するためのビューです。 注釈 このページの例のいくつかは、 myapp/models.py 内で下記の通り Article モデルが定義されていると仮定します: from django.db import models from django.urls import reverse class Article ( models . ... models . CharField ( max_length = 200 ) pub_date = models . DateField () def get_absolute_url ( self ): return reverse ( "article-detail" , kwargs = { "pk" : self . pk }) ArchiveIndexView ¶ class ArchiveIndexView [ソース] ¶ "最新の"オブジェクトを、日付 ... pp/urls.py : from django.urls import path from django.views.generic.dates import ArchiveIndexView from myapp.models import Article urlpatterns = [ path ( "archive/" , ArchiveIndexView . as_view ( model = Article , date_field = "pub_date" ), name = "arti ...
https://man.mtool.work/django/6.1/ref/class-based-views/generic-date-based.html
Django の概要 — Django 6.1 ドキュメント 9326
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » Django の概要 ¶ Django は変転の激しいニュースルーム環境で開発された経緯から、よくある Web 開発タスクを迅速かつ簡単化するように設計されています。ここ ... ( models . Model ): full_name = models . CharField ( max_length = 70 ) def __str__ ( self ): return self . full_name class Article ( models . Model ): pub_date = models . DateField () headline = models . CharField ( max_length = 200 ) content = models . ... で生成され、コードを作成する必要はありません: # Import the models we created from our "news" app >>> from news.models import Article , Reporter # No reporters are in the system yet. >>> Reporter . objects . all () <QuerySet []> # Create a new Reporter. >> ... . get ( id = 2 ) Traceback (most recent call last): ... DoesNotExist : Reporter matching query does not exist. # Create an article. >>> from datetime import date >>> a = Article ( ... pub_date = date . today (), headline = "Django is cool" , content = " ...
https://man.mtool.work/django/6.1/intro/overview.html
Django の概要 — Django 6.1 ドキュメント 9326
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » Django の概要 ¶ Django は変転の激しいニュースルーム環境で開発された経緯から、よくある Web 開発タスクを迅速かつ簡単化するように設計されています。ここ ... ( models . Model ): full_name = models . CharField ( max_length = 70 ) def __str__ ( self ): return self . full_name class Article ( models . Model ): pub_date = models . DateField () headline = models . CharField ( max_length = 200 ) content = models . ... で生成され、コードを作成する必要はありません: # Import the models we created from our "news" app >>> from news.models import Article , Reporter # No reporters are in the system yet. >>> Reporter . objects . all () <QuerySet []> # Create a new Reporter. >> ... . get ( id = 2 ) Traceback (most recent call last): ... DoesNotExist : Reporter matching query does not exist. # Create an article. >>> from datetime import date >>> a = Article ( ... pub_date = date . today (), headline = "Django is cool" , content = " ...
https://man.mtool.work/django/6.1/intro/overview.html
ジェネリック表示ビュー (Generic display view) — Django 6.1 ドキュメント 8811
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » ジェネリック表示ビュー (Generic display view) ¶ 以下の2つのクラスベースのジェネリックビューは、データを表示 (display) するために設計されています。多 ... o_response() 例 myapp/views.py : from 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 ): ... ta ( ** kwargs ) context [ "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-det ... ail" ), ] 例 myapp/article_detail.html : < h1 > {{ object.headline }} </ h1 > < p > {{ object.content }} </ p > < p > Reporter: {{ object.reporter }} ...
https://man.mtool.work/django/6.1/ref/class-based-views/generic-display.html
ジェネリック表示ビュー (Generic display view) — Django 6.1 ドキュメント 8560
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » ジェネリック表示ビュー (Generic display view) ¶ 以下の2つのクラスベースのジェネリックビューは、データを表示 (display) するために設計されています。多 ... o_response() 例 myapp/views.py : from 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 ): ... ta ( ** kwargs ) context [ "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-det ... ail" ), ] 例 myapp/article_detail.html : < h1 > {{ object.headline }} </ h1 > < p > {{ object.content }} </ p > < p > Reporter: {{ object.reporter }} ...
https://man.mtool.work/django/6.1/ref/class-based-views/generic-display.html
PREV 1 2 3 4 5 6 NEXT