per page, with , order by , clip by
Results of 1 - 10 of about 116 for Author (0.008 sec.)
データベース関数 — Django 6.1 ドキュメント 10448
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » データベース関数 ¶ The classes documented below provide a way for users to use functions provided by the underlying database as annotations, aggrega ... regate functions . See the Func documentation for security considerations. 各関数の例では、以下のモデルを使用します: class Author ( models . Model ): name = models . CharField ( max_length = 50 ) age = models . PositiveIntegerField ( null = True , blan ... 強制的に変更します。 使用例: >>> from django.db.models import FloatField >>> from django.db.models.functions import Cast >>> Author . objects . create ( age = 25 , name = "Margaret Smith" ) >>> author = Author . objects . annotate ( ... age_as_float = Ca ... st ( "age" , output_field = FloatField ()), ... ) . get () >>> print ( author . age_as_float ) 25.0 Coalesce ¶ class Coalesce ( * expressions , ** extra ) [ソース] ¶ 少なくとも2つのフィールド名または式 ...
https://man.mtool.work/django/6.1/ref/models/database-functions.html
データベース関数 — Django 6.1 ドキュメント 10448
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » データベース関数 ¶ The classes documented below provide a way for users to use functions provided by the underlying database as annotations, aggrega ... regate functions . See the Func documentation for security considerations. 各関数の例では、以下のモデルを使用します: class Author ( models . Model ): name = models . CharField ( max_length = 50 ) age = models . PositiveIntegerField ( null = True , blan ... 強制的に変更します。 使用例: >>> from django.db.models import FloatField >>> from django.db.models.functions import Cast >>> Author . objects . create ( age = 25 , name = "Margaret Smith" ) >>> author = Author . objects . annotate ( ... age_as_float = Ca ... st ( "age" , output_field = FloatField ()), ... ) . get () >>> print ( author . age_as_float ) 25.0 Coalesce ¶ class Coalesce ( * expressions , ** extra ) [ソース] ¶ 少なくとも2つのフィールド名または式 ...
https://man.mtool.work/django/6.1/ref/models/database-functions.html
モデルからフォームを作成する — Django 6.1 ドキュメント 10298
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » モデルからフォームを作成する ¶ ModelForm ¶ class ModelForm [ソース] ¶ データベース中心のアプリケーションを作成している場合、Django モデルに密接にマッ ... import models from django.forms import ModelForm TITLE_CHOICES = { "MR" : "Mr." , "MRS" : "Mrs." , "MS" : "Ms." , } class Author ( models . Model ): name = models . CharField ( max_length = 100 ) title = models . CharField ( max_length = 3 , choices = ... e ) def __str__ ( self ): return self . name class Book ( models . Model ): name = models . CharField ( max_length = 100 ) authors = models . ManyToManyField ( Author ) class AuthorForm ( ModelForm ): class Meta : model = Author fields = [ "name" , "ti ... tle" , "birth_date" ] class BookForm ( ModelForm ): class Meta : model = Book fields = [ "name" , "authors" ] これらのモデルでは、上記の ModelForm サブクラスはおおむね以下と同等と言えます (唯一の違いは save() メソッドで、これから ...
https://man.mtool.work/django/6.1/topics/forms/modelforms.html
モデルからフォームを作成する — Django 6.1 ドキュメント 10298
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » モデルからフォームを作成する ¶ ModelForm ¶ class ModelForm [ソース] ¶ データベース中心のアプリケーションを作成している場合、Django モデルに密接にマッ ... import models from django.forms import ModelForm TITLE_CHOICES = { "MR" : "Mr." , "MRS" : "Mrs." , "MS" : "Ms." , } class Author ( models . Model ): name = models . CharField ( max_length = 100 ) title = models . CharField ( max_length = 3 , choices = ... e ) def __str__ ( self ): return self . name class Book ( models . Model ): name = models . CharField ( max_length = 100 ) authors = models . ManyToManyField ( Author ) class AuthorForm ( ModelForm ): class Meta : model = Author fields = [ "name" , "ti ... tle" , "birth_date" ] class BookForm ( ModelForm ): class Meta : model = Book fields = [ "name" , "authors" ] これらのモデルでは、上記の ModelForm サブクラスはおおむね以下と同等と言えます (唯一の違いは save() メソッドで、これから ...
https://man.mtool.work/django/6.1/topics/forms/modelforms.html
配信 (syndication) フィード フレームワーク — Django 6.1 ドキュメント 9859
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » 配信 (syndication) フィード フレームワーク ¶ Django には、 RSS と Atom フィードを作成するための高レベルな配信 (syndication) フィード生成フレームワー ... """ Returns the feed's description as a normal Python string. """ description = "Foo bar baz." # Hard-coded description. # AUTHOR NAME --One of the following three is optional. The framework # looks for them in this order. def author_name ( self , obj ... ): """ Takes the object returned by get_object() and returns the feed's author's name as a normal Python string. """ def author_name ( self ): """ Returns the feed's author's name as a normal Python st ... ring. """ author_name = "Sally Smith" # Hard-coded author name. # AUTHOR EMAIL --One of the following three is optional. The framework # lo ...
https://man.mtool.work/django/6.1/ref/contrib/syndication.html
配信 (syndication) フィード フレームワーク — Django 6.1 ドキュメント 9859
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » 配信 (syndication) フィード フレームワーク ¶ Django には、 RSS と Atom フィードを作成するための高レベルな配信 (syndication) フィード生成フレームワー ... """ Returns the feed's description as a normal Python string. """ description = "Foo bar baz." # Hard-coded description. # AUTHOR NAME --One of the following three is optional. The framework # looks for them in this order. def author_name ( self , obj ... ): """ Takes the object returned by get_object() and returns the feed's author's name as a normal Python string. """ def author_name ( self ): """ Returns the feed's author's name as a normal Python st ... ring. """ author_name = "Sally Smith" # Hard-coded author name. # AUTHOR EMAIL --One of the following three is optional. The framework # lo ...
https://man.mtool.work/django/6.1/ref/contrib/syndication.html
クラスベースのビューでフォームを扱う — Django 6.1 ドキュメント 9270
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » クラスベースのビューでフォームを扱う ¶ フォームの処理には、一般に3つの場合分けが存在します。 最初の GET リクエスト (空白またはデフォルト値が埋め込ま ... 合、 form_class が ModelForm だったとしても、モデルを指定する必要があります。 First we need to add get_absolute_url() to our Author class: models.py ¶ from django.db import models from django.urls import reverse class Author ( models . Model ): name = mo ... dels . CharField ( max_length = 200 ) def get_absolute_url ( self ): return reverse ( "author-detail" , kwargs = { "pk" : self . pk }) そうしたら、 CreateView およびその仲間たちを使って実際に動作させることができます。 ... ls import reverse_lazy from django.views.generic.edit import CreateView , DeleteView , UpdateView from myapp.models import Author class AuthorCreateView ( CreateView ): model = Author fields = [ "name" ] class AuthorUpdateView ( UpdateView ): model = A ...
https://man.mtool.work/django/6.1/topics/class-based-views/generic-editing.html
クラスベースのビューでフォームを扱う — Django 6.1 ドキュメント 9195
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » クラスベースのビューでフォームを扱う ¶ フォームの処理には、一般に3つの場合分けが存在します。 最初の GET リクエスト (空白またはデフォルト値が埋め込ま ... 合、 form_class が ModelForm だったとしても、モデルを指定する必要があります。 First we need to add get_absolute_url() to our Author class: models.py ¶ from django.db import models from django.urls import reverse class Author ( models . Model ): name = mo ... dels . CharField ( max_length = 200 ) def get_absolute_url ( self ): return reverse ( "author-detail" , kwargs = { "pk" : self . pk }) そうしたら、 CreateView およびその仲間たちを使って実際に動作させることができます。 ... ls import reverse_lazy from django.views.generic.edit import CreateView , DeleteView , UpdateView from myapp.models import Author class AuthorCreateView ( CreateView ): model = Author fields = [ "name" ] class AuthorUpdateView ( UpdateView ): model = A ...
https://man.mtool.work/django/6.1/topics/class-based-views/generic-editing.html
ジェネリック編集ビュー (Generic editing view) — Django 6.1 ドキュメント 8757
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » ジェネリック編集ビュー (Generic editing view) ¶ 以下のビューは、このページで説明され、内容を編集するための基礎を提供します: django.views.generic.edi ... SuccessMessageMixin が含まれており、フォーム送信の成功に関するメッセージを表示できます。 注釈 このページの例のいくつかは、 Author モデルが下記の通り myapp/models.py 内で定義されているものと見なしています。 from django.db import models from django.urls ... import reverse class Author ( models . Model ): name = models . CharField ( max_length = 200 ) def get_absolute_url ( self ): return reverse ( "author ... ストに描画された CreateView のページは、 '_form' の template_name_suffix を使います。 例えば、この属性をオブジェクト (例えば Author モデル) を作成するビューのために '_create_form' に変更すると、 デフォルトの template_name は 'myapp/author_create_form.htm ...
https://man.mtool.work/django/6.1/ref/class-based-views/generic-editing.html
ジェネリック編集ビュー (Generic editing view) — Django 6.1 ドキュメント 8569
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » ジェネリック編集ビュー (Generic editing view) ¶ 以下のビューは、このページで説明され、内容を編集するための基礎を提供します: django.views.generic.edi ... SuccessMessageMixin が含まれており、フォーム送信の成功に関するメッセージを表示できます。 注釈 このページの例のいくつかは、 Author モデルが下記の通り myapp/models.py 内で定義されているものと見なしています。 from django.db import models from django.urls ... import reverse class Author ( models . Model ): name = models . CharField ( max_length = 200 ) def get_absolute_url ( self ): return reverse ( "author ... ストに描画された CreateView のページは、 '_form' の template_name_suffix を使います。 例えば、この属性をオブジェクト (例えば Author モデル) を作成するビューのために '_create_form' に変更すると、 デフォルトの template_name は 'myapp/author_create_form.htm ...
https://man.mtool.work/django/6.1/ref/class-based-views/generic-editing.html
PREV 1 2 3 4 5 6 7 8 9 10 NEXT