per page, with , order by , clip by
Results of 1 - 10 of about 186 for CharField (0.013 sec.)
フォーム フィールド — Django 6.1 ドキュメント 9502
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » フォーム フィールド ¶ class Field [ソース] ¶ Form クラスを作成時の一番重要な部分は、form のフィールド (field) の定義です。各フィールドにはカスタムの ... くは空文字列 ( "" )) を渡すと、 clean() は ValidationError 例外を発生させます。 >>> from django import forms >>> f = forms . CharField () >>> f . clean ( "foo" ) 'foo' >>> f . clean ( "" ) Traceback (most recent call last): ... ValidationError : ['This fiel ... e ) 'False' フィールドが必須で ない ことを指定するには、 Field コンストラクタに required=False を渡します: >>> f = forms . CharField ( required = False ) >>> f . clean ( "foo" ) 'foo' >>> f . clean ( "" ) '' >>> f . clean ( None ) '' >>> f . clean ( 0 ) ' ... れていて、 clean() に空の値を渡した場合、 clean() は ValidationError を発生させる代わりに、 正規化された 空の値を返します。 CharField の場合、これは empty_value を返し、デフォルトでは空の文字列となります。他の Field クラスでは、 None になることもあります。 ...
https://man.mtool.work/django/6.1/ref/forms/fields.html
フォーム フィールド — Django 6.1 ドキュメント 9502
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » フォーム フィールド ¶ class Field [ソース] ¶ Form クラスを作成時の一番重要な部分は、form のフィールド (field) の定義です。各フィールドにはカスタムの ... くは空文字列 ( "" )) を渡すと、 clean() は ValidationError 例外を発生させます。 >>> from django import forms >>> f = forms . CharField () >>> f . clean ( "foo" ) 'foo' >>> f . clean ( "" ) Traceback (most recent call last): ... ValidationError : ['This fiel ... e ) 'False' フィールドが必須で ない ことを指定するには、 Field コンストラクタに required=False を渡します: >>> f = forms . CharField ( required = False ) >>> f . clean ( "foo" ) 'foo' >>> f . clean ( "" ) '' >>> f . clean ( None ) '' >>> f . clean ( 0 ) ' ... れていて、 clean() に空の値を渡した場合、 clean() は ValidationError を発生させる代わりに、 正規化された 空の値を返します。 CharField の場合、これは empty_value を返し、デフォルトでは空の文字列となります。他の Field クラスでは、 None になることもあります。 ...
https://man.mtool.work/django/6.1/ref/forms/fields.html
モデル _meta API — Django 6.1 ドキュメント 9326
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » モデル _meta API ¶ class Options [ソース] ¶ モデルの _meta API は、Django ORM のコアにあります。これにより、ルックアップ、クエリ、フォーム、admin な ... ontrib.auth.models import User # A field on the model >>> User . _meta . get_field ( "username" ) <django.db.models.fields.CharField: username> # A field from another model that has a relation with the current model >>> User . _meta . get_field ( "logentr ... . _meta . get_fields () (<ManyToOneRel: admin.logentry>, <django.db.models.fields.AutoField: id>, <django.db.models.fields.CharField: password>, <django.db.models.fields.DateTimeField: last_login>, <django.db.models.fields.BooleanField: is_superuser>, <dj ... ango.db.models.fields.CharField: username>, <django.db.models.fields.CharField: first_name>, <django.db.models.fields.CharField: last_name>, <django.db.mo ...
https://man.mtool.work/django/6.1/ref/models/meta.html
モデル _meta API — Django 6.1 ドキュメント 9326
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » モデル _meta API ¶ class Options [ソース] ¶ モデルの _meta API は、Django ORM のコアにあります。これにより、ルックアップ、クエリ、フォーム、admin な ... ontrib.auth.models import User # A field on the model >>> User . _meta . get_field ( "username" ) <django.db.models.fields.CharField: username> # A field from another model that has a relation with the current model >>> User . _meta . get_field ( "logentr ... . _meta . get_fields () (<ManyToOneRel: admin.logentry>, <django.db.models.fields.AutoField: id>, <django.db.models.fields.CharField: password>, <django.db.models.fields.DateTimeField: last_login>, <django.db.models.fields.BooleanField: is_superuser>, <dj ... ango.db.models.fields.CharField: username>, <django.db.models.fields.CharField: first_name>, <django.db.models.fields.CharField: last_name>, <django.db.mo ...
https://man.mtool.work/django/6.1/ref/models/meta.html
モデル — Django 6.1 ドキュメント 9063
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » モデル ¶ モデルは、データに関する唯一かつ決定的な情報源です。あなたが保持するデータが必要とするフィールドとその動作を定義します。一般的に、各モデルは ... Person というモデルを定義しています。 from django.db import models class Person ( models . Model ): first_name = models . CharField ( max_length = 30 ) last_name = models . CharField ( max_length = 30 ) first_name および last_name はこのモデルの フィール ... れないことに注意してください。 実装例: from django.db import models class Musician ( models . Model ): first_name = models . CharField ( max_length = 50 ) last_name = models . CharField ( max_length = 50 ) instrument = models . CharField ( max_length = 100 ... ) class Album ( models . Model ): artist = models . ForeignKey ( Musician , on_delete = models . CASCADE ) name = models . CharField ( max_length = 100 ) release_date = models . DateField () num_stars = models . IntegerField () フィールドの型 ¶ モデル内の ...
https://man.mtool.work/django/6.1/topics/db/models.html
モデル — Django 6.1 ドキュメント 9063
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » モデル ¶ モデルは、データに関する唯一かつ決定的な情報源です。あなたが保持するデータが必要とするフィールドとその動作を定義します。一般的に、各モデルは ... Person というモデルを定義しています。 from django.db import models class Person ( models . Model ): first_name = models . CharField ( max_length = 30 ) last_name = models . CharField ( max_length = 30 ) first_name および last_name はこのモデルの フィール ... れないことに注意してください。 実装例: from django.db import models class Musician ( models . Model ): first_name = models . CharField ( max_length = 50 ) last_name = models . CharField ( max_length = 50 ) instrument = models . CharField ( max_length = 100 ... ) class Album ( models . Model ): artist = models . ForeignKey ( Musician , on_delete = models . CASCADE ) name = models . CharField ( max_length = 100 ) release_date = models . DateField () num_stars = models . IntegerField () フィールドの型 ¶ モデル内の ...
https://man.mtool.work/django/6.1/topics/db/models.html
マネージャ — Django 6.1 ドキュメント 7810
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » マネージャ ¶ class Manager [ソース] ¶ マネージャ (Manager) とは、Django のモデルに対するデータベースクエリの操作を提供するインターフェイスです。Djan ... ( num_responses = Coalesce ( models . Count ( "response" ), 0 )) class OpinionPoll ( models . Model ): question = models . CharField ( max_length = 200 ) objects = PollManager () class Response ( models . Model ): poll = models . ForeignKey ( OpinionPoll ... トを返します。 たとえば、このモデルの例では...: from django.db import models class Book ( models . Model ): title = models . CharField ( max_length = 100 ) author = models . CharField ( max_length = 50 ) Book.objects.all() は、データベース内の全ての本を返し ... r ( author = "Roald Dahl" ) # Then hook it into the Book model explicitly. class Book ( models . Model ): title = models . CharField ( max_length = 100 ) author = models . CharField ( max_length = 50 ) objects = models . Manager () # The default manager. ...
https://man.mtool.work/django/6.1/topics/db/managers.html
モデルフィールドリファレンス — Django 6.1 ドキュメント 7722
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » モデルフィールドリファレンス ¶ このドキュメントには、Django が提供するフィールドオプション field options とフィールド型 field types を含む、 Field の ... です。 null ¶ Field. null ¶ True の場合、Django はデータベース内に NULL として空の値を保持します。デフォルトは False です。 CharField や TextField などの文字列ベースのフィールドでは、 null の使用は避けてください。Django は習慣的に、文字列ベースのフィールド ... なし」を表す値が NULL と空文字列の 2 通りになります。多くの場合、「データなし」を表す値が 2 つあるのは冗長です。例外として、 CharField に unique=True と blank=True の両方を設定する場合があります。この状況では、空文字列のオブジェクトを複数保存する際に一意制約 ... ss Expense ( models . Model ): amount = models . DecimalField ( max_digits = 10 , decimal_places = 2 ) currency = models . CharField ( max_length = 3 , choices = get_currencies ) choice に呼び出し可能オブジェクトを渡すと、例えば選択肢が以下のような場合に特 ...
https://man.mtool.work/django/6.1/ref/models/fields.html
モデルからフォームを作成する — Django 6.1 ドキュメント 7722
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » モデルからフォームを作成する ¶ ModelForm ¶ class ModelForm [ソース] ¶ データベース中心のアプリケーションを作成している場合、Django モデルに密接にマッ ... でフォームフィールドを有します。 各モデルフィールドは、対応するデフォルトのフォームフィールドを持ちます。例えば、モデル上の CharField はフォーム上で CharField として表現されます。モデル ManyToManyField は MultipleChoiceField として表現されます。 以下は、各 ... ax_value に 9223372036854775807 セットされます。 BinaryField editable がモデルフィールド上で True にセットされていた場合、 CharField です。それ以外の場合フォーム内で描画されません。 BooleanField BooleanField です。 null=True の場合は NullBooleanField です ... 。 CharField CharField で、 max_length はモデルフィールドの max_length にセットされます。また null=True の場合 empty_value が None にセ ...
https://man.mtool.work/django/6.1/topics/forms/modelforms.html
フォーム API — Django 6.1 ドキュメント 7634
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » フォーム API ¶ このドキュメントについて このドキュメントでは、Django のフォーム API の詳細について説明します。このドキュメントを読む前に フォームにつ ... l が提供され、後者が優先されます。 >>> from django import forms >>> class CommentForm ( forms . Form ): ... name = forms . CharField ( initial = "class" ) ... url = forms . URLField () ... comment = forms . CharField () ... >>> f = CommentForm ( initial = ... は、その fields 属性からアクセスできます。 >>> for row in f . fields . values (): ... print ( row ) ... <django.forms.fields.CharField object at 0x7ffaac632510> <django.forms.fields.URLField object at 0x7ffaac632f90> <django.forms.fields.CharField object at ... 0x7ffaac3aa050> >>> f . fields [ "name" ] <django.forms.fields.CharField object at 0x7ffaac6324d0> フィールドと BoundField 、 Form インスタンスを変更することで、フォーム内でのフィールドの表示方法 ...
https://man.mtool.work/django/6.1/ref/forms/api.html
PREV 1 2 3 4 5 6 7 8 9 10 NEXT