... class Meta : constraints = [ models . CheckConstraint ( condition = models . Q ( age__gte = 18 ), name = "age_gte_18" ), ] verbose_name ¶ Options. verbose_name ¶ 人間が読めるオブジェクトの名前(単数形): verbose_name = "pizza" 指定されない場合、 Django ... はクラス名を小文字にして使います。 CamelCase は camel case になります。 verbose_name_plural ¶ Options. verbose_name_plural ¶ オブジェクトの名前の複数形: verbose_name_plural = "stories" 指定されない場合、 ... Django は verbose_name + "s" を使用します。 読み取り専用の Meta 属性 ¶ label ¶ Options. label ¶ オブジェクトの表現。 app_label.object_name を ... ... class Meta : constraints = [ models . CheckConstraint ( condition = models . Q ( age__gte = 18 ), name = "age_gte_18" ), ] verbose_name ¶ Options. verbose_name ¶ 人間が読めるオブジェクトの名前(単数形): verbose_name = "pizza" 指定されない場合、 Django ... はクラス名を小文字にして使います。 CamelCase は camel case になります。 verbose_name_plural ¶ Options. verbose_name_plural ¶ オブジェクトの名前の複数形: verbose_name_plural = "stories" 指定されない場合、 ... Django は verbose_name + "s" を使用します。 読み取り専用の Meta 属性 ¶ label ¶ Options. label ¶ オブジェクトの表現。 app_label.object_name を ... ... mport ngettext from myapp.models import Report count = Report . objects . count () if count == 1 : name = Report . _meta . verbose_name else : name = Report . _meta . verbose_name_plural text = ngettext ( "There is %(count)d %(name)s available." , "Ther ... vailable." , "There are %(count)d %(name)s objects available." , count , ) % { "count" : count , "name" : Report . _meta . verbose_name , } 注釈 ngettext() を使うときは、リテラルで挿入される全ての変数に対して単一の名前を使うようにしてください。以下の例で ... are %(count)d %(plural_name)s available." , count , ) % { "count" : Report . objects . count (), "name" : Report . _meta . verbose_name , "plural_name" : Report . _meta . verbose_name_plural , } django-admin compilemessages を実行すると、以下のエラーが発 ... ... mport ngettext from myapp.models import Report count = Report . objects . count () if count == 1 : name = Report . _meta . verbose_name else : name = Report . _meta . verbose_name_plural text = ngettext ( "There is %(count)d %(name)s available." , "Ther ... vailable." , "There are %(count)d %(name)s objects available." , count , ) % { "count" : count , "name" : Report . _meta . verbose_name , } 注釈 ngettext() を使うときは、リテラルで挿入される全ての変数に対して単一の名前を使うようにしてください。以下の例で ... are %(count)d %(plural_name)s available." , count , ) % { "count" : Report . objects . count (), "name" : Report . _meta . verbose_name , "plural_name" : Report . _meta . verbose_name_plural , } django-admin compilemessages を実行すると、以下のエラーが発 ... ... 、 primary_key=True が必ず 1 つだけ (明示的に宣言されるか、自動的に追加されるかのどちらかで) 存在する必要があります。 詳細 (verbose) なフィールド名 ¶ ForeignKey 、 ManyToManyField 、 OneToOneField を除くすべてのフィールド型は、任意の第 1 引数として "詳細 ... な名前 (verbose name)" を取ります。詳細な名前を指定しない場合、Django はフィールドの属性名のアンダースコアをスペースに変換したものを使って ... eld ( max_length = 30 ) ForeignKey 、 ManyToManyField 、 OneToOneField の 3 つは最初の引数にモデルクラスを必要とするので、 verbose_name キーワード引数を使用してください: poll = models . ForeignKey ( Poll , on_delete = models . CASCADE , verbose_name = " ... ... 、 primary_key=True が必ず 1 つだけ (明示的に宣言されるか、自動的に追加されるかのどちらかで) 存在する必要があります。 詳細 (verbose) なフィールド名 ¶ ForeignKey 、 ManyToManyField 、 OneToOneField を除くすべてのフィールド型は、任意の第 1 引数として "詳細 ... な名前 (verbose name)" を取ります。詳細な名前を指定しない場合、Django はフィールドの属性名のアンダースコアをスペースに変換したものを使って ... eld ( max_length = 30 ) ForeignKey 、 ManyToManyField 、 OneToOneField の 3 つは最初の引数にモデルクラスを必要とするので、 verbose_name キーワード引数を使用してください: poll = models . ForeignKey ( Poll , on_delete = models . CASCADE , verbose_name = " ... ... GC name. ... } # The mapping is a dictionary >>> lm = LayerMapping ( TestGeo , "test_poly.shp" , mapping ) >>> lm . save ( verbose = True ) # Save the layermap, imports the data. Saved: Name: 1 Saved: Name: 2 Saved: Name: 3 Here, LayerMapping transforme ... ポートする際に使用するデータベースを設定します。デフォルトは 'default' です。 save() のキーワード引数 ¶ LayerMapping. save ( verbose = False , fid_range = False , step = False , progress = False , silent = False , stream = sys.stdout , strict = False ) [ソ ... model mapping will cease upon the first error encountered. The default value ( False ) behavior is to attempt to continue. verbose 設定された場合、データベース上で実行される各モデル保存の後に情報が出力されます。 トラブルシューティング ¶ メモリ不足 ¶ As ... ... GC name. ... } # The mapping is a dictionary >>> lm = LayerMapping ( TestGeo , "test_poly.shp" , mapping ) >>> lm . save ( verbose = True ) # Save the layermap, imports the data. Saved: Name: 1 Saved: Name: 2 Saved: Name: 3 Here, LayerMapping transforme ... ポートする際に使用するデータベースを設定します。デフォルトは 'default' です。 save() のキーワード引数 ¶ LayerMapping. save ( verbose = False , fid_range = False , step = False , progress = False , silent = False , stream = sys.stdout , strict = False ) [ソ ... model mapping will cease upon the first error encountered. The default value ( False ) behavior is to attempt to continue. verbose 設定された場合、データベース上で実行される各モデル保存の後に情報が出力されます。 トラブルシューティング ¶ メモリ不足 ¶ As ... ... not be used for any string that may require translation, including error and logging messages. In general format() is more verbose, so the other formatting methods are preferred. Don't waste time doing unrelated refactoring of existing code to adjust th ... del ): first_name = models . CharField ( max_length = 20 ) last_name = models . CharField ( max_length = 40 ) class Meta : verbose_name_plural = "people" Don't do this: class Person ( models . Model ): class Meta : verbose_name_plural = "people" first_n ... ... not be used for any string that may require translation, including error and logging messages. In general format() is more verbose, so the other formatting methods are preferred. Don't waste time doing unrelated refactoring of existing code to adjust th ... del ): first_name = models . CharField ( max_length = 20 ) last_name = models . CharField ( max_length = 40 ) class Meta : verbose_name_plural = "people" Don't do this: class Person ( models . Model ): class Meta : verbose_name_plural = "people" first_n ... 2026年10月08日