per page, with , order by , clip by
Results of 1 - 10 of about 35 for formset (0.005 sec.)
フォームセット (Formset) 14607
フォームセット (Formset) class BaseFormSet [ソース] フォームセットは、同じページで複数のフォームを扱うための抽象レイヤーです。データグリッドに例えるとわかりやすいでしょう。次のようなフォームがあるとしましょう: >>> from django import forms > ... ようにしたいと思うかもしれません。 ArticleForm からフォームセットを作るには、次のようにします: >>> from django.forms import formset_factory >>> ArticleFormSet = formset_factory ( ArticleForm ) これで ArticleFormSet という名前のフォームセットクラスが作成さ ... ームセットをインスタンス化することで、フォームセット内のフォームをイテレートし、通常のフォームと同じように表示できます: >>> formset = ArticleFormSet () >>> for form in formset : ... print ( form ) ... <div><label for="id_form-0-title">Title:</label><inpu ... おり、空のフォームがひとつだけ表示されました。表示される空のフォームの数は extra パラメータで制御できます。デフォルトでは、 formset_factory() は空のフォームを1つ定義します。次の例では、フォームセットクラスを作成して空のフォームを2つ表示します: >>> Articl ...
https://man.mtool.work/django/6.1/topics/forms/formsets.html
フォームセット (Formset) の関数 11870
フォームセット (Formset) の関数 フォームセット (Formset) の API リファレンスです。Formset についての導入的な情報は、 フォームセット (Formset) トピックガイドを参照してください。 formset_factory formset_factory ( form , formset = BaseFormSet ... validate_min = False , absolute_max = None , can_delete_extra = True , renderer = None ) [ソース] 与えられた form クラスの FormSet クラスを返します。 使用例は フォームセット を見てください。 ...
https://man.mtool.work/django/6.1/ref/forms/formsets.html
モデルからフォームを作成する 11393
モデルからフォームを作成する ModelForm class ModelForm [ソース] データベース中心のアプリケーションを作成している場合、Django モデルに密接にマップするフォームを使うことになるでしょう。例えば、 BlogComment モデルを持っていて、閲覧者がコメント ... _factory ( Author , form = AuthorForm , localized_fields = [ "birth_date" ]) モデルのフォームセット class models. BaseModelFormSet 通常のフォームセット のように、 Django は Django モデルでの作業をより便利にするために、いくつかの拡張 フォームセットクラス ... を提供しています。上の Author モデルを再利用してみましょう: >>> from django.forms import modelformset_factory >>> from myapp.models import Author >>> AuthorFormSet = modelformset_factory ( Author , fields = [ "name" , "title ... だけを使うように制限されます。または、除外するフィールドを指定する "オプトアウト" アプローチをとることもできます: >>> AuthorFormSet = modelformset_factory ( Author , exclude = [ "birth_date" ]) これは Author モデルに関連付けられたデータを扱うことができる ...
https://man.mtool.work/django/6.1/topics/forms/modelforms.html
admin アプリケーションの JavaScript カスタマイズ 9945
admin アプリケーションの JavaScript カスタマイズ インラインフォームイベント インラインフォームが admin アプリケーション変更フォームに追加または削除された際に JavaScript を実行したい場合、 formset:added と formset:removed イベントを使用できま ... す。 event.detail.formsetName は行が属するフォームセットを示します。 formset:added イベントでは、 event.target は新しく追加された行です。 カスタムの ... html' %} {% load static %} {% block admin_change_form_document_ready %} {{ block .super }} < script src = " {% static 'app/formset_handlers.js' %} " ></ script > {% endblock %} app/static/app/formset_handlers.js document . addEventListener ( 'formset:ad ... ded' , ( event ) => { if ( event . detail . formsetName == 'author_set' ) { // Do something } }); document . addEventListener ( 'formset:removed' , ( event ) => { // Row remo ...
https://man.mtool.work/django/6.1/ref/contrib/admin/javascript.html
Django 4.1 リリースノート 8306
Django 4.1 リリースノート 2022年8月3日 Django 4.1 へようこそ! このリリースノートでは、 バージョン 4.1 の新機能 と、Django 4.0 以前からアップグレードする際に注意すべき、 後方互換性のない変更 について説明します。また、 一部の機能を非推奨 とし ... form, like {{ form }} in a template, from Django 5.0. In order to ease adopting the new output style, the default form and formset templates are now configurable at the project level via the FORM_RENDERER setting. See the Forms section (below) for full ... overridden with a string value to specify the template name per-form class. Similarly, the default template used to render formsets can be specified via the matching formset_template_name renderer attribute. The new div.html form template, referencing F ... output style is not appropriate for your project, you should define a renderer subclass specifying form_template_name and formset_template_name for your required style, and set FORM_RENDERER accordingly. For example, for the <p> output style used by as ...
https://man.mtool.work/django/6.1/releases/4.1.html
モデルフォーム 8179
モデルフォーム ModelForm API リファレンス。 ModelForm の使用に関する入門的な資料は、トピックガイドの モデルからフォームを作成する を参照してください。 モデルフォームの Meta API class ModelFormOptions [ソース] The _meta API is used to build ... フィールドを選択する を参照してください。使うフィールドの定義を省略すると、 ImproperlyConfigured 例外を引き起こします。 modelformset_factory modelformset_factory ( model , form = ModelForm , formfield_callback = None , formset = BaseModelFormSet , extra = ... te_max = None , can_delete_extra = True , renderer = None , edit_only = False ) [ソース] 与えられた model クラスに対して、 FormSet クラスを返します。 引数 model 、 form 、 fields 、 exclude 、 formfield_callback 、 widgets 、 localized_fields 、 labels ... 、 help_texts 、 error_messages 、 field_classes は、すべて modelform_factory() を通して引き渡されます。 引数 formset , extra , can_delete , can_order , max_num , validate_max , min_num , validate_min , absolute_max , can_delete_extra , およ ...
https://man.mtool.work/django/6.1/ref/forms/models.html
Django 1.3.6 リリースノート 8179
Django 1.3.6 リリースノート February 19, 2013 Django 1.3.6 fixes four security issues present in previous Django releases in the 1.3 series. This is the sixth bugfix/security release in the Django 1.3 series. Host header poisoning Some part ... if you feed your own XML documents to the loaddata management command, you will need to ensure they do not contain a DTD. Formset memory exhaustion Previous versions of Django did not validate or limit the form-count data provided by the client in a fo ... possible to exhaust a server's available memory by forcing it to create very large numbers of forms. In Django 1.3.6, all formsets have a strictly-enforced maximum number of forms (1000 by default, though it can be set higher via the max_num formset fa ...
https://man.mtool.work/django/6.1/releases/1.3.6.html
Django 1.4.4 リリースノート 8147
Django 1.4.4 リリースノート February 19, 2013 Django 1.4.4 fixes four security issues present in previous Django releases in the 1.4 series, as well as several other bugs and numerous documentation improvements. This is the fourth bugfix/se ... if you feed your own XML documents to the loaddata management command, you will need to ensure they do not contain a DTD. Formset memory exhaustion Previous versions of Django did not validate or limit the form-count data provided by the client in a fo ... possible to exhaust a server's available memory by forcing it to create very large numbers of forms. In Django 1.4.4, all formsets have a strictly-enforced maximum number of forms (1000 by default, though it can be set higher via the max_num formset fa ...
https://man.mtool.work/django/6.1/releases/1.4.4.html
Django の admin サイト 8051
Django の admin サイト Django のパワフルな特徴の1つは、自動的に生成される admin インタフェースです。あなたのモデルクラスからメタデータを読み取り、モデル中心のインタフェースを提供します。このインタフェースのおかげで、ユーザはあなたのサイトの ... れら自身のカスタムウィジェットを暗示するからです。 ModelAdmin. inlines 後述の InlineModelAdmin オブジェクトと ModelAdmin.get_formsets_with_inlines() を参照してください。 ModelAdmin. list_display admin のチェンジリストページでどのフィールドを表示するかコン ... をオーバーライドすると、"選択したオブジェクトの削除" アクション に対する削除のプロセスをカスタムできます。 ModelAdmin. save_formset ( request , form , formset , change ) [ソース] save_formset メソッドには、 HttpRequest 、親 ModelForm のインスタンス、親オ ... のインスタンスそれぞれに request.user を追加するには、次のようにします。 class ArticleAdmin ( admin . ModelAdmin ): def save_formset ( self , request , form , formset , change ): instances = formset . save ( commit = False ) for obj in formset . deleted_o ...
https://man.mtool.work/django/6.1/ref/contrib/admin/
Django 1.3 リリースノート 8051
Django 1.3 リリースノート March 23, 2011 Django 1.3 へようこそ! Nearly a year in the making, Django 1.3 includes quite a few new features and plenty of bug fixes and improvements to existing features. These release notes cover the new featu ... include Armed Forces postal codes. This is backwards-incompatible if you were relying on USStateField not including them. FormSet updates In Django 1.3 FormSet creation behavior is modified slightly. Historically the class didn't make a distinction bet ... This was inconsistent with behavior in other parts of the framework. Starting with 1.3 if you pass in empty dictionary the FormSet will raise a ValidationError . 以下は FormSet を使用した例です。 >>> class ArticleForm ( Form ): ... title = CharField () ... ... pub_date = DateField () ... >>> ArticleFormSet = formset_factory ( ArticleForm ) 以下のコードでは ValidationError が発生します。 >>> ArticleFormSet ({}) Traceback (most ...
https://man.mtool.work/django/6.1/releases/1.3.html
PREV 1 2 3 4 NEXT