... 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" 指定されない場合、 Dj ... ango は 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 を実行すると、以下のエラーが発 ... ... 、 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 note ... ... 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 ... ... tter if you want to include additional data. First name and define your formatters - this example defines formatters named verbose and simple : LOGGING = { # ... "formatters" : { "verbose" : { "format" : " {name} {levelname} {asctime} {module} {process: ... ントリを追加します: "handlers" : { "file" : { "class" : "logging.FileHandler" , "filename" : "general.log" , "formatter" : "verbose" , }, } ロガーの名前空間を使う 無名のロギング設定 "" は任意の Python アプリケーションからログを取り込みます。名前付きロギン ... ... ailable for details. Action description % -formatting support Action descriptions support % -formatting and may include '%(verbose_name)s' and '%(verbose_name_plural)s' placeholders. These are replaced with the model's verbose_name and verbose_name_plur ... ... ps import apps >>> apps . get_app_config ( "admin" ) . verbose_name 'Administration' プロジェクトとアプリケーション プロジェクト (project) という単語は、Django の web アプリケーションを ... でしょう: # rock_n_roll/apps.py from django.apps import AppConfig class RockNRollConfig ( AppConfig ): name = "rock_n_roll" verbose_name = "Rock 'n' roll" RockNRollConfig は INSTALLED_APPS が 'rock_n_roll' を含むときに自動的に読み込まれます。もしこれを防 ... うにします。 # anthology/apps.py from rock_n_roll.apps import RockNRollConfig class JazzManoucheConfig ( RockNRollConfig ): verbose_name = "Jazz Manouche" # anthology/settings.py INSTALLED_APPS = [ "anthology.apps.JazzManoucheConfig" , # ... ] この例では ... ... ss PersonAdmin ( admin . ModelAdmin ): readonly_fields = [ "address_report" ] # description functions like a model field's verbose_name @admin . display ( description = "Address" ) def address_report ( self , instance ): # assuming get_full_address() re ... ェクトも含まれます。リストはテンプレート内で unordered_list フィルタを使ってフォーマットされます。 model_count は各モデルの verbose_name_plural と削除されるオブジェクトの数をマッピングした辞書です。 perms_needed は verbose_name のセットで、ユーザが削除す ... pages" ] InlineModelAdmin. template ページ上でインラインをレンダリングするのに使われるテンプレートです。 InlineModelAdmin. verbose_name モデル内部の Meta クラスの verbose_name のオーバーライドです。 InlineModelAdmin. verbose_name_plural モデル内部の Met ... ... constructor arguments have been adapted to match those of all other model fields. The first two keyword arguments are now verbose_name and name. Other bugfixes and changes Subclass HTMLParser only for appropriate Python versions (#18239). Added batch_s ... 2026年10月08日