per page, with , order by , clip by
Results of 1 - 2 of about 2 for YearInSchool (0.014 sec.)
モデルフィールドリファレンス — Django 6.1 ドキュメント 11228
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » モデルフィールドリファレンス ¶ このドキュメントには、Django が提供するフィールドオプション field options とフィールド型 field types を含む、 Field の ... ラス化できる列挙型があります: from django.utils.translation import gettext_lazy as _ class Student ( models . Model ): class YearInSchool ( models . TextChoices ): FRESHMAN = "FR" , _ ( "Freshman" ) SOPHOMORE = "SO" , _ ( "Sophomore" ) JUNIOR = "JR" , _ ( "Jun ... "SR" , _ ( "Senior" ) GRADUATE = "GR" , _ ( "Graduate" ) year_in_school = models . CharField ( max_length = 2 , choices = YearInSchool , default = YearInSchool . FRESHMAN , ) def is_upperclass ( self ): return self . year_in_school in { self . YearInSchool ... . JUNIOR , self . YearInSchool . SENIOR , } これらはPythonの標準ライブラリの enum と似たような動作をしますが、若干の変更が加えられています: 列挙型のメンバ ...
https://man.mtool.work/django/6.1/ref/models/fields.html
モデルフィールドリファレンス — Django 6.1 ドキュメント 7485
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » モデルフィールドリファレンス ¶ このドキュメントには、Django が提供するフィールドオプション field options とフィールド型 field types を含む、 Field の ... ラス化できる列挙型があります: from django.utils.translation import gettext_lazy as _ class Student ( models . Model ): class YearInSchool ( models . TextChoices ): FRESHMAN = "FR" , _ ( "Freshman" ) SOPHOMORE = "SO" , _ ( "Sophomore" ) JUNIOR = "JR" , _ ( "Jun ... "SR" , _ ( "Senior" ) GRADUATE = "GR" , _ ( "Graduate" ) year_in_school = models . CharField ( max_length = 2 , choices = YearInSchool , default = YearInSchool . FRESHMAN , ) def is_upperclass ( self ): return self . year_in_school in { self . YearInSchool ... . JUNIOR , self . YearInSchool . SENIOR , } これらはPythonの標準ライブラリの enum と似たような動作をしますが、若干の変更が加えられています: 列挙型のメンバ ...
https://man.mtool.work/django/6.1/ref/models/fields.html
PREV 1 NEXT