... old_db_table , new_db_table ) [ソース] ¶ モデルのテーブル名を old_db_table から new_db_table に変更します。 alter_db_table_comment() ¶ BaseDatabaseSchemaEditor. alter_db_table_comment ( model , old_db_table_comment , new_db_table_comment ) [ソース] ¶ mo ... del のテーブルコメントを new_db_table_comment に変更します。 alter_db_tablespace() ¶ BaseDatabaseSchemaEditor. alter_db_tablespace ( model , old_db_tablespace , new_db_ ... ndex() add_constraint() remove_constraint() alter_unique_together() alter_index_together() alter_db_table() alter_db_table_comment() alter_db_tablespace() add_field() remove_field() alter_field() 属性 connection 前のトピックへ リクエストとレスポンスのオ ... ... の場合は True を、すべての値が null または値が存在しない場合は default を、それ以外の場合は False を返します。 使用例: class Comment ( models . Model ): body = models . TextField () published = models . BooleanField () rank = models . IntegerField () >>> ... from django.db.models import Q >>> from django.contrib.postgres.aggregates import BoolAnd >>> Comment . objects . aggregate ( booland = BoolAnd ( "published" )) {'booland': False} >>> Comment . objects . aggregate ( booland ... rue の場合は True を、すべての値が null または値がない場合は default を、そうでない場合は False を返します。 使用例: class Comment ( models . Model ): body = models . TextField () published = models . BooleanField () rank = models . IntegerField () >>> ... ... ルドに別のウィジェットを使用したい場合は、フィールド定義で widget 引数を使用できます。例えば: from django import forms class CommentForm ( forms . Form ): name = forms . CharField () url = forms . URLField () comment = forms . CharField ( widget = forms . ... Textarea ) これは、comment のフォームに対して、デフォルトの TextInput ウィジェットではなく、より大きなサイズの Textarea ウィジェットを指定しています。 ... S ファイルにいくつか記述を追加する必要もあります)。 たとえば、以下のフォームを取り上げます: from django import forms class CommentForm ( forms . Form ): name = forms . CharField () url = forms . URLField () comment = forms . CharField () このフォームには ... ... old_db_table , new_db_table ) [ソース] ¶ モデルのテーブル名を old_db_table から new_db_table に変更します。 alter_db_table_comment() ¶ BaseDatabaseSchemaEditor. alter_db_table_comment ( model , old_db_table_comment , new_db_table_comment ) [ソース] ¶ mo ... del のテーブルコメントを new_db_table_comment に変更します。 alter_db_tablespace() ¶ BaseDatabaseSchemaEditor. alter_db_tablespace ( model , old_db_tablespace , new_db_ ... ndex() add_constraint() remove_constraint() alter_unique_together() alter_index_together() alter_db_table() alter_db_table_comment() alter_db_tablespace() add_field() remove_field() alter_field() 属性 connection 前のトピックへ リクエストとレスポンスのオ ... ... 結果として、 psycopg2 との違いを考慮した変更が必要になるかもしれません。 カラムとテーブルにおけるコメント ¶ 新しい Field.db_comment と Meta.db_table_comment オプションは、それぞれカラムとテーブルにコメントを作成できるようにします。例えば: from django.db ... import models class Question ( models . Model ): text = models . TextField ( db_comment = "Poll question" ) pub_date = models . DateTimeField ( db_comment = "Date and time when the question was published" , ) c ... lass Meta : db_table_comment = "Poll questions" class Answer ( models . Model ): question = models . ForeignKey ( Question , on_delete = models . CASCA ... ... ルドに別のウィジェットを使用したい場合は、フィールド定義で widget 引数を使用できます。例えば: from django import forms class CommentForm ( forms . Form ): name = forms . CharField () url = forms . URLField () comment = forms . CharField ( widget = forms . ... Textarea ) これは、comment のフォームに対して、デフォルトの TextInput ウィジェットではなく、より大きなサイズの Textarea ウィジェットを指定しています。 ... S ファイルにいくつか記述を追加する必要もあります)。 たとえば、以下のフォームを取り上げます: from django import forms class CommentForm ( forms . Form ): name = forms . CharField () url = forms . URLField () comment = forms . CharField () このフォームには ... ... 結果として、 psycopg2 との違いを考慮した変更が必要になるかもしれません。 カラムとテーブルにおけるコメント ¶ 新しい Field.db_comment と Meta.db_table_comment オプションは、それぞれカラムとテーブルにコメントを作成できるようにします。例えば: from django.db ... import models class Question ( models . Model ): text = models . TextField ( db_comment = "Poll question" ) pub_date = models . DateTimeField ( db_comment = "Date and time when the question was published" , ) c ... lass Meta : db_table_comment = "Poll questions" class Answer ( models . Model ): question = models . ForeignKey ( Question , on_delete = models . CASCA ... ... the pull request, marks the ticket as "Accepted", sets the flags "needs tests" and "patch needs improvement", and leaves a comment explaining how Alice can improve the patch. This puts the ticket automatically into the "waiting on author" queue within t ... eeds PR review" queue. Charlie reviews the pull request, sets the "patch needs improvement" flag again, and leaves another comment suggesting changes to the implementation. The ticket moves back to the "waiting on author" queue. Alice updates the pull r ... "Needs tests" and "Needs documentation" are self-explanatory. "Patch needs improvement" will generally be accompanied by a comment on the ticket explaining what is needed to improve the code. Ready For Checkin ¶ The ticket was reviewed by any member of ... ... the pull request, marks the ticket as "Accepted", sets the flags "needs tests" and "patch needs improvement", and leaves a comment explaining how Alice can improve the patch. This puts the ticket automatically into the "waiting on author" queue within t ... eeds PR review" queue. Charlie reviews the pull request, sets the "patch needs improvement" flag again, and leaves another comment suggesting changes to the implementation. The ticket moves back to the "waiting on author" queue. Alice updates the pull r ... "Needs tests" and "Needs documentation" are self-explanatory. "Patch needs improvement" will generally be accompanied by a comment on the ticket explaining what is needed to improve the code. Ready For Checkin ¶ The ticket was reviewed by any member of ... ... の場合は True を、すべての値が null または値が存在しない場合は default を、それ以外の場合は False を返します。 使用例: class Comment ( models . Model ): body = models . TextField () published = models . BooleanField () rank = models . IntegerField () >>> ... from django.db.models import Q >>> from django.contrib.postgres.aggregates import BoolAnd >>> Comment . objects . aggregate ( booland = BoolAnd ( "published" )) {'booland': False} >>> Comment . objects . aggregate ( booland ... rue の場合は True を、すべての値が null または値がない場合は default を、そうでない場合は False を返します。 使用例: class Comment ( models . Model ): body = models . TextField () published = models . BooleanField () rank = models . IntegerField () >>> ... 2026年10月08日