per page, with , order by , clip by
Results of 1 - 7 of about 7 for TextChoices (0.006 sec.)
Django 3.0.3 リリースノート 12232
Django 3.0.3 リリースノート 2020年2月3日 Django 3.0.3 では、セキュリティの問題1件と 3.0.2 におけるいくつかのバグを修正しました。 CVE-2020-7471: StringAgg(delimiter) を通じた潜在的 SQL インジェクション StringAgg 集計関数には、適切に加工された ... E のサブ言語を利用できるように Django 3.0 で追加されたシステムチェックの設定を緩めました ( #31141 )。 テンプレートで列挙型 TextChoices 、 IntegerChoices 、そして Choices が使えるようになりました ( #31154 )。 名前付きグループが非文字列の値しか含まない場合でも ...
https://man.mtool.work/django/6.1/releases/3.0.3.html
Django 3.0 リリースノート 10814
Django 3.0 リリースノート 2019年12月2日 Django 3.0 へようこそ! このリリースノートでは、 バージョン 3.0 の新機能 と、Django 2.2 以前からアップグレードする際に注意すべき、 後方互換性のない変更 について説明します。 非推奨サイクルが終了した機能 ... ng to first annotate and then filter against the annotation. Enumerations for model field choices Custom enumeration types TextChoices , IntegerChoices , and Choices are now available as a way to define Field.choices . TextChoices and IntegerChoices types a ...
https://man.mtool.work/django/6.1/releases/3.0.html
Django 5.0 リリースノート 9378
Django 5.0 リリースノート 2023年12月4日 Django 5.0 へようこそ! このリリースノートでは、 バージョン 5.0 の新機能 と、Django 4.2 以前からアップグレードする際に注意すべき、 後方互換性のない変更 について説明します。また、 一部の機能を非推奨 とし ... 、 .choices 属性にアクセスして、期待される形式で値を提供する必要がありました: from django.db import models Medal = models . TextChoices ( "Medal" , "GOLD SILVER BRONZE" ) SPORT_CHOICES = [ ( "Martial Arts" , [( "judo" , "Judo" ), ( "karate" , "Karate" )]), ( ... ようになり、 列挙型 を直接展開することで、 .choices の使用が不要になりました。 from django.db import models Medal = models . TextChoices ( "Medal" , "GOLD SILVER BRONZE" ) SPORT_CHOICES = { # Using a mapping instead of a list of 2-tuples. "Martial Arts" : { " ...
https://man.mtool.work/django/6.1/releases/5.0.html
Coding style 8669
Coding style Please follow these coding standards when writing code for inclusion in Django. Pre-commit checks pre-commit is a framework for managing pre-commit hooks. These hooks help to identify simple issues before committing code for re ... TION_DOWN : "Down" , } Alternatively, consider using 列挙型 : class MyModel ( models . Model ): class Direction ( models . TextChoices ): UP = "U" , "Up" DOWN = "D" , "Down" Use of django.conf.settings Modules should not in general use settings stored in dj ...
https://man.mtool.work/django/6.1/internals/contributing/writing-code/coding-sty...
モデルフィールドリファレンス 8669
モデルフィールドリファレンス このドキュメントには、Django が提供するフィールドオプション field options とフィールド型 field types を含む、 Field のすべての API リファレンスが記載されています。 注釈 フィールドは django.db.models.fields に定義 ... ます: from django.utils.translation import gettext_lazy as _ class Student ( models . Model ): class YearInSchool ( models . TextChoices ): FRESHMAN = "FR" , _ ( "Freshman" ) SOPHOMORE = "SO" , _ ( "Sophomore" ) JUNIOR = "JR" , _ ( "Junior" ) SENIOR = "SR" , ... 自動設定させることができます(アンダースコアをスペースに置き換え、タイトルケースを使用します): >>> class Vehicle ( models . TextChoices ): ... CAR = "C" ... TRUCK = "T" ... JET_SKI = "J" ... >>> Vehicle . JET_SKI . label 'Jet Ski' 列挙値が整数である必要がある ... Enum Functional API を利用することもできます。この場合、ラベルは上記のように自動的に生成されます: >>> MedalType = models . TextChoices ( "MedalType" , "GOLD SILVER BRONZE" ) >>> MedalType . choices [('GOLD', 'Gold'), ('SILVER', 'Silver'), ('BRONZE', 'Bronze ...
https://man.mtool.work/django/6.1/ref/models/fields.html
マイグレーション 7252
マイグレーション マイグレーション (Migrations) は、Django でモデルに対して行った変更 (フィールドの追加やモデルの削除など) をデータベーススキーマに反映させる方法です。大抵のマイグレーションは自動で行われるものの、いつマイグレーションが作られ ... e converted to str or bytes using os.fspath() LazyObject instances which wrap a serializable value Enumeration types (e.g. TextChoices or IntegerChoices ) instances 任意の Django フィールド 任意の関数またはメソッドへのリファレンス (例: datetime.datetime.tod ...
https://man.mtool.work/django/6.1/topics/migrations.html
モデル 6543
モデル モデルは、データに関する唯一かつ決定的な情報源です。あなたが保持するデータが必要とするフィールドとその動作を定義します。一般的に、各モデルは単一のデータベースのテーブルに対応付けられます。 基本: モデルは各々 Python のクラスであり dja ... hoices を簡潔に定義することもできます。 from django.db import models class Runner ( models . Model ): MedalType = models . TextChoices ( "MedalType" , "GOLD SILVER BRONZE" ) name = models . CharField ( max_length = 60 ) medal = models . CharField ( blank = ...
https://man.mtool.work/django/6.1/topics/db/models.html
PREV 1 NEXT