per page, with , order by , clip by
Results of 1 - 10 of about 222 for save (0.006 sec.)
モデルからフォームを作成する — Django 6.1 ドキュメント 10587
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » モデルからフォームを作成する ¶ ModelForm ¶ class ModelForm [ソース] ¶ データベース中心のアプリケーションを作成している場合、Django モデルに密接にマッ ... ields = [ "name" , "authors" ] これらのモデルでは、上記の ModelForm サブクラスはおおむね以下と同等と言えます (唯一の違いは save() メソッドで、これからすぐ説明します): from django import forms class AuthorForm ( forms . Form ): name = forms . CharFiel ... : error_messages = { NON_FIELD_ERRORS : { "unique_together" : " %(model_name)s 's %(field_labels)s are not unique." , } } save() メソッド ¶ 全ての ModelForm は save() メソッドも持っています。このメソッドは、フォームに結びつけられたデータからデータベ ... delForm のサブクラスはキーワード引数 instance として既存のモデルインスタンスを受け取ることができます; これが指定されると、 save() はそのインスタンスを更新するようになります。 指定されない場合は、 save() は指定されたモデルの新しいインスタンスを生成しま ...
https://man.mtool.work/django/6.1/topics/forms/modelforms.html
モデルからフォームを作成する — Django 6.1 ドキュメント 10587
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » モデルからフォームを作成する ¶ ModelForm ¶ class ModelForm [ソース] ¶ データベース中心のアプリケーションを作成している場合、Django モデルに密接にマッ ... ields = [ "name" , "authors" ] これらのモデルでは、上記の ModelForm サブクラスはおおむね以下と同等と言えます (唯一の違いは save() メソッドで、これからすぐ説明します): from django import forms class AuthorForm ( forms . Form ): name = forms . CharFiel ... : error_messages = { NON_FIELD_ERRORS : { "unique_together" : " %(model_name)s 's %(field_labels)s are not unique." , } } save() メソッド ¶ 全ての ModelForm は save() メソッドも持っています。このメソッドは、フォームに結びつけられたデータからデータベ ... delForm のサブクラスはキーワード引数 instance として既存のモデルインスタンスを受け取ることができます; これが指定されると、 save() はそのインスタンスを更新するようになります。 指定されない場合は、 save() は指定されたモデルの新しいインスタンスを生成しま ...
https://man.mtool.work/django/6.1/topics/forms/modelforms.html
モデルインスタンスリファレンス — Django 6.1 ドキュメント 9181
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » モデルインスタンスリファレンス ¶ このドキュメントでは、 Model API の詳細を説明しています。 モデル と データベースクエリ ガイドにある説明を前提として ... ields you've defined on your model. Note that instantiating a model in no way touches your database; for that, you need to save() . 注釈 You may be tempted to customize the model by overriding the __init__ method. If you do so, however, take care not ... to change the calling signature as any change may prevent the model instance from being saved. Additionally, referring to model fields within __init__ may potentially result in infinite recursion errors in some circ ... though a field assigned a value of a different type (for example, a string assigned to a UUIDField ) may be converted when save() executes a query, the in-memory instance will keep the original value until it is reloaded . モデルの読み込みをカスタマイ ...
https://man.mtool.work/django/6.1/ref/models/instances.html
モデルインスタンスリファレンス — Django 6.1 ドキュメント 9129
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » モデルインスタンスリファレンス ¶ このドキュメントでは、 Model API の詳細を説明しています。 モデル と データベースクエリ ガイドにある説明を前提として ... ields you've defined on your model. Note that instantiating a model in no way touches your database; for that, you need to save() . 注釈 You may be tempted to customize the model by overriding the __init__ method. If you do so, however, take care not ... to change the calling signature as any change may prevent the model instance from being saved. Additionally, referring to model fields within __init__ may potentially result in infinite recursion errors in some circ ... though a field assigned a value of a different type (for example, a string assigned to a UUIDField ) may be converted when save() executes a query, the in-memory instance will keep the original value until it is reloaded . モデルの読み込みをカスタマイ ...
https://man.mtool.work/django/6.1/ref/models/instances.html
File オブジェクト — Django 6.1 ドキュメント 8723
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » File オブジェクト ¶ django.core.files モジュールとそのサブモジュールでは、Django の基本的なファイルハンドリングに関するビルトインクラスが定義されてい ... ッド ¶ オブジェクト(以下の Car.photo のように)に関連付けられた File には、いくつかの追加メソッドも用意されています。 File. save ( name , content , save = True ) ¶ 提供されたファイル名と内容で新しいファイルを保存します。これは既存のファイルを置き換える ... ものではありませんが、新しいファイルを作成し、オブジェクトがそれを指すように更新します。 save が True の場合、ファイルが保存されたらモデルの save() メソッドが一度呼び出されます。つまり、次の二行です: >>> car . photo ... . save ( "myphoto.jpg" , content , save = False ) >>> car . save () これは以下と同等です: >>> car . photo . save ( "myphoto.jpg" ...
https://man.mtool.work/django/6.1/ref/files/file.html
File オブジェクト — Django 6.1 ドキュメント 8661
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » File オブジェクト ¶ django.core.files モジュールとそのサブモジュールでは、Django の基本的なファイルハンドリングに関するビルトインクラスが定義されてい ... ッド ¶ オブジェクト(以下の Car.photo のように)に関連付けられた File には、いくつかの追加メソッドも用意されています。 File. save ( name , content , save = True ) ¶ 提供されたファイル名と内容で新しいファイルを保存します。これは既存のファイルを置き換える ... ものではありませんが、新しいファイルを作成し、オブジェクトがそれを指すように更新します。 save が True の場合、ファイルが保存されたらモデルの save() メソッドが一度呼び出されます。つまり、次の二行です: >>> car . photo ... . save ( "myphoto.jpg" , content , save = False ) >>> car . save () これは以下と同等です: >>> car . photo . save ( "myphoto.jpg" ...
https://man.mtool.work/django/6.1/ref/files/file.html
複数のデータベース — Django 6.1 ドキュメント 7266
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » 複数のデータベース ¶ ここでは、Djangoがサポートする複数データベースの扱いについて説明します。残りのDjangoのドキュメントの大部分は、あなたが一つのデー ... object instance that is related to the read or write operation that is underway. This might be the instance that is being saved, or it might be an instance that is being added in a many-to-many relation. In some cases, no instance hint will be provi ... he 'auth_db' database >>> fred = User . objects . get ( username = "fred" ) >>> fred . first_name = "Frederick" >>> # This save will also be directed to 'auth_db' >>> fred . save () >>> # These retrieval will be randomly allocated to a replica databa ... ent will consult the router, and set mh onto >>> # the same database as the author object >>> mh . author = dna >>> # This save will force the 'mh' instance onto the primary database... >>> mh . save () >>> # ... but if we re-retrieve the object, it ...
https://man.mtool.work/django/6.1/topics/db/multi-db.html
複数のデータベース — Django 6.1 ドキュメント 7266
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » 複数のデータベース ¶ ここでは、Djangoがサポートする複数データベースの扱いについて説明します。残りのDjangoのドキュメントの大部分は、あなたが一つのデー ... object instance that is related to the read or write operation that is underway. This might be the instance that is being saved, or it might be an instance that is being added in a many-to-many relation. In some cases, no instance hint will be provi ... he 'auth_db' database >>> fred = User . objects . get ( username = "fred" ) >>> fred . first_name = "Frederick" >>> # This save will also be directed to 'auth_db' >>> fred . save () >>> # These retrieval will be randomly allocated to a replica databa ... ent will consult the router, and set mh onto >>> # the same database as the author object >>> mh . author = dna >>> # This save will force the 'mh' instance onto the primary database... >>> mh . save () >>> # ... but if we re-retrieve the object, it ...
https://man.mtool.work/django/6.1/topics/db/multi-db.html
データベースのトランザクション — Django 6.1 ドキュメント 7141
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » データベースのトランザクション ¶ Django では、データベースのトランザクションをコントロールする方法が提供されています。 データベースのトランザクション ... する ¶ Django は、データベーストランザクションをコントロールするための一つの API を提供しています。 atomic ( using = None , savepoint = True , durable = False ) [ソース] ¶ Atomicityは、データベーストランザクションの定義プロパティです。 atomic は、デー ... DatabaseError , transaction obj = MyModel ( active = False ) obj . active = True try : with transaction . atomic (): obj . save () except DatabaseError : obj . active = False if obj . active : ... これはキャッシュやグローバル変数など、アプリの状態を保 ... を解放するかロールバックします; 一番外側のブロックを抜けるときに、トランザクションをコミットするかロールバック します。 引数 savepoint を False に設定することで、内部ブロックのセーブポイン トの作成を無効にできます。例外が発生した場合、 Django はセーブポ ...
https://man.mtool.work/django/6.1/topics/db/transactions.html
データベースのトランザクション — Django 6.1 ドキュメント 7141
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » データベースのトランザクション ¶ Django では、データベースのトランザクションをコントロールする方法が提供されています。 データベースのトランザクション ... する ¶ Django は、データベーストランザクションをコントロールするための一つの API を提供しています。 atomic ( using = None , savepoint = True , durable = False ) [ソース] ¶ Atomicityは、データベーストランザクションの定義プロパティです。 atomic は、デー ... DatabaseError , transaction obj = MyModel ( active = False ) obj . active = True try : with transaction . atomic (): obj . save () except DatabaseError : obj . active = False if obj . active : ... これはキャッシュやグローバル変数など、アプリの状態を保 ... を解放するかロールバックします; 一番外側のブロックを抜けるときに、トランザクションをコミットするかロールバック します。 引数 savepoint を False に設定することで、内部ブロックのセーブポイン トの作成を無効にできます。例外が発生した場合、 Django はセーブポ ...
https://man.mtool.work/django/6.1/topics/db/transactions.html
PREV 1 2 3 4 5 6 7 8 9 10 NEXT