per page, with , order by , clip by
Results of 1 - 10 of about 54 for initial (0.009 sec.)
フォーム API 14952
フォーム API このドキュメントについて このドキュメントでは、Django のフォーム API の詳細について説明します。このドキュメントを読む前に フォームについての概要 を読むことをおすすめします。 バインドされた (bound) フォームとバインドされていない ... ームでは次のような結果になります。 >>> f = ContactForm () >>> f . is_valid () False >>> f . errors {} フォームの初期値 Form. initial initial を使うことで、実行時にフォームの初期値を設定できます。たとえば、 username フォームを埋めるのに、現在のセッションの ... username を使うことができます。 これを実現するには、 Form の初期化時に initial 引数を使用します。この引数には、フィールド名と初期値のマッピングした辞書を指定します。初期値を指定するフィールドだけを含め ... ればよく、フォーム内のすべてのフィールドを含める必要はありません。以下に例を示します。 >>> f = ContactForm ( initial = { "subject" : "Hi there!" }) これらの値はバインドされていないフォームに表示されるだけです。値が入力されなかった場合の、フ ...
https://man.mtool.work/django/6.1/ref/forms/api.html
フォームセット (Formset) 12074
フォームセット (Formset) class BaseFormSet [ソース] フォームセットは、同じページで複数のフォームを扱うための抽象レイヤーです。データグリッドに例えるとわかりやすいでしょう。次のようなフォームがあるとしましょう: >>> from django import forms > ... rms import ArticleForm >>> ArticleFormSet = formset_factory ( ArticleForm , extra = 2 ) >>> formset = ArticleFormSet ( ... initial = [ ... { ... "title" : "Django is now open source" , ... "pub_date" : datetime . date . today (), ... } ... ] ... ) >>> f ... つの追加フォームです。初期データとして、辞書のリストを渡していることにも注意してください。 フォームセットを描画するために initial を使う場合、フォームセットの送信を処理するときに同じ initial を渡して、どのフォームがユーザによって変更されたかをフォームセ ... ットが検出できるようにしてください。例えば、 ArticleFormSet(request.POST, initial=[...]) のようになるでしょう。 参考 モデルフォームセットを使ってモデルからフォームセットを作る . フォームの最大表示数を制限 ...
https://man.mtool.work/django/6.1/topics/forms/formsets.html
マイグレーション 9538
マイグレーション マイグレーション (Migrations) は、Django でモデルに対して行った変更 (フィールドの追加やモデルの削除など) をデータベーススキーマに反映させる方法です。大抵のマイグレーションは自動で行われるものの、いつマイグレーションが作られ ... jango is going to do or if you have database administrators who require SQL scripts for changes. To inspect the SQL of the initial migration that created the tables for the books models above, run: $ python manage.py sqlmigrate books 0001 You should see ... ooks_book_author_id_8b91747b_fk_books_author_id" FOREIGN KEY ( "author_id" ) REFERENCES "books_author" ( "id" ) DEFERRABLE INITIALLY DEFERRED ; CREATE INDEX "books_book_author_id_8b91747b" ON "books_book" ( "author_id" ); COMMIT ; Note the following: Th ... om django.db import migrations , models class Migration ( migrations . Migration ): dependencies = [( "migrations" , "0001_initial" )] operations = [ migrations . DeleteModel ( "Tribble" ), migrations . AddField ( "Author" , "rating" , models . IntegerF ...
https://man.mtool.work/django/6.1/topics/migrations.html
ミックスイン (mixin) を編集する 9093
ミックスイン (mixin) を編集する 以下のミックスイン (mixin) は、Djangoの編集ビューを構築するのに使用されます。 django.views.generic.edit.FormMixin django.views.generic.edit.ModelFormMixin django.views.generic.edit.ProcessFormView django.view ... ームを作成したり表示したりする機能を提供するmixinクラス。 ミックスイン django.views.generic.base.ContextMixin メソッドと属性 initial フォームの初期化データのディクショナリ。 form_class インスタンス化するフォームクラス。 success_url フォームが正常に処理され ... たときにリダイレクトするURL。 prefix 生成されるフォームの prefix 。 get_initial () フォームの初期データを取得します。デフォルトでは、 initial のコピーを返します。 get_form_class () インスタンス化するフォ ... 合は get_form_class() が使用されます。 get_form_kwargs () フォームのインスタンス化に必要なキーワード引数を構築します。 引数 initial には get_initial() を指定します。 リクエストが POST または PUT の場合、リクエストデータ ( request.POST と request.FILES ) ...
https://man.mtool.work/django/6.1/ref/class-based-views/mixins-editing.html
フォーム フィールド 9093
フォーム フィールド class Field [ソース] Form クラスを作成時の一番重要な部分は、form のフィールド (field) の定義です。各フィールドにはカスタムの検証ロジックがあり、他にいくつかのフックもあります。 Field. clean ( value ) [ソース] Field クラス ... l for="id_captcha_answer">2 + 2 =</label><input type="number" name="captcha_answer" required id="id_captcha_answer"></div> initial Field. initial initial 属性は、 Field が結びつけられていない Form で表示されるときに使われる初期値を指定します。 動的に初期 ... 値を指定する方法は、 Form.initial パラメータを参照してください。 これの使用例は、あるフィールドが特定の値で初期化された「空」のフォームを表示したい場合です。 ... 例えば: >>> from django import forms >>> class CommentForm ( forms . Form ): ... name = forms . CharField ( initial = "Your name" ) ... url = forms . URLField ( initial = "https://" ) ... comment = forms . CharField () ... >>> f = Comment ...
https://man.mtool.work/django/6.1/ref/forms/fields.html
クラスベースのジェネリックビュー: フラットインデックス 8974
クラスベースのジェネリックビュー: フラットインデックス この索引は、クラスベースビューのリファレンス文書を、異なる観点から編成したものです。ビューごとに、クラスツリーの有効な属性とメソッドが表されます。動作を定義するクラスの観点から編集された ... class FormView 属性 (とオプションのアクセサ): content_type extra_context form_class [ get_form_class() ] http_method_names initial [ get_initial() ] prefix [ get_prefix() ] response_class [ render_to_response() ] success_url [ get_success_url() ] templa ... e context_object_name [ get_context_object_name() ] extra_context fields form_class [ get_form_class() ] http_method_names initial [ get_initial() ] model pk_url_kwarg prefix [ get_prefix() ] query_pk_and_slug queryset [ get_queryset() ] response_class ... e context_object_name [ get_context_object_name() ] extra_context fields form_class [ get_form_class() ] http_method_names initial [ get_initial() ] model pk_url_kwarg prefix [ get_prefix() ] query_pk_and_slug queryset [ get_queryset() ] response_class ...
https://man.mtool.work/django/6.1/ref/class-based-views/flattened-index.html
Django 1.11.4 リリースノート 8870
Django 1.11.4 リリースノート August 1, 2017 Django 1.11.4 fixes several bugs in 1.11.3. バグ修正 Fixed a regression in 1.11.3 on Python 2 where non-ASCII format values for date/time widgets results in an empty value in the widget's HTML ( # ... able_file_input.html widget templates will need to adapt for the fact that context values checkbox_name , checkbox_id , is_initial , input_text , initial_text , and clear_checkbox_label are now attributes of widget rather than appearing in the top-level ...
https://man.mtool.work/django/6.1/releases/1.11.4.html
Django 1.7 リリースノート 8766
Django 1.7 リリースノート September 2, 2014 Django 1.7 へようこそ! このリリースノートでは、 バージョン 1.7 の新機能 と、Django 1.6 以前からアップグレードする際に注意すべき、 後方互換性のない変更 について説明します。 非推奨サイクルが終了した ... but that method name is deprecated and you should change it as soon as possible (nothing more than renaming is required). initial_data fixtures are no longer loaded for apps with migrations; if you want to load initial data for an app, we suggest you c ... for a ModelAdmin.list_display value by prefixing the admin_order_field value with a hyphen. The ModelAdmin.get_changeform_initial_data() method may be overridden to define custom behavior for setting initial change form data. django.contrib.auth Any ** ... es, methods or managers. Make sure your allow_migrate methods are only referring to fields or other items in model._meta . initial_data Apps with migrations will not load initial_data fixtures when they have finished migrating. Apps without migrations w ...
https://man.mtool.work/django/6.1/releases/1.7.html
Django 1.8 リリースノート 8321
Django 1.8 リリースノート April 1, 2015 Django 1.8 へようこそ! このリリースノートでは、 バージョン 1.8 の新機能 と、Django 1.7 以前からアップグレードする際に注意すべき、 後方互換性のない変更 について説明します。 非推奨サイクルが終了した機能 ... functionality such as Coalesce , Concat , and Substr . TestCase data setup TestCase has been refactored to allow for data initialization at the class level using transactions and savepoints. Database backends which do not support transactions, like MyS ... the database version is 3.0 or later. The PostGIS 2 CREATE EXTENSION postgis and the SpatiaLite SELECT InitSpatialMetaData initialization commands are now automatically run by migrate . The GDAL interface now supports retrieving properties of raster (im ... anagement commands with options using call_command() , the option name can match the command line option name (without the initial dashes) or the final option destination variable name, but in either case, the resulting option received by the command is ...
https://man.mtool.work/django/6.1/releases/1.8.html
モデルからフォームを作成する 8099
モデルからフォームを作成する ModelForm class ModelForm [ソース] データベース中心のアプリケーションを作成している場合、Django モデルに密接にマップするフォームを使うことになるでしょう。例えば、 BlogComment モデルを持っていて、閲覧者がコメント ... y attempt to save() a ModelForm with missing fields will fail. To avoid this failure, you must instantiate your model with initial values for the missing, but required fields: author = Author ( title = "Mr" ) form = PartialAuthorForm ( request . POST , ... 使うフィールドを選択する を参照してください。 初期値を指定する 通常のフォームと同様に、フォームのインスタンスを作成する際に initial パラメータを指定することで、フォームの初期データを指定できます。この方法で指定された初期値は、フォームフィールドからの初期 ... ようにします: >>> article = Article . objects . get ( pk = 1 ) >>> article . headline 'My headline' >>> form = ArticleForm ( initial = { "headline" : "Initial headline" }, instance = article ) >>> form [ "headline" ] . value () 'Initial headline' ModelFor ...
https://man.mtool.work/django/6.1/topics/forms/modelforms.html
PREV 1 2 3 4 5 6 NEXT