... ようにします。 条件付きでアクションを有効/無効にする ¶ ModelAdmin. get_actions ( request , action_location = ActionLocation.CHANGE_LIST ) [ソース] ¶ 最後に、 ModelAdmin.get_actions() をオーバーライドすることで、リクエスト単位で (つまりユーザ単位で) 条件 ... ます。 class MyModelAdmin ( admin . ModelAdmin ): ... def get_actions ( self , request , action_location = ActionLocation . CHANGE_LIST ): actions = super () . get_actions ( request , action_location = action_location ) if request . user . username [ 0 ... ] . upper () != "J" : if "delete_selected" in actions : del actions [ "delete_selected" ] return actions Changed in Django 6.1: The keyword argument action_location was added. The return type was changed to a dictionary where the keys ... ... ようにします。 条件付きでアクションを有効/無効にする ¶ ModelAdmin. get_actions ( request , action_location = ActionLocation.CHANGE_LIST ) [ソース] ¶ 最後に、 ModelAdmin.get_actions() をオーバーライドすることで、リクエスト単位で (つまりユーザ単位で) 条件 ... ます。 class MyModelAdmin ( admin . ModelAdmin ): ... def get_actions ( self , request , action_location = ActionLocation . CHANGE_LIST ): actions = super () . get_actions ( request , action_location = action_location ) if request . user . username [ 0 ... ] . upper () != "J" : if "delete_selected" in actions : del actions [ "delete_selected" ] return actions Changed in Django 6.1: The keyword argument action_location was added. The return type was changed to a dictionary where the keys ... ... 値モデルおよび変更 (start - end) を記録する Experiment モデルがあります。変化が一定の量に等しい ( Experiment.objects.filter(change__abs=27) )、またはそれが一定の量を超えなかった ( Experiment.objects.filter(change__abs__lt=27) ) すべての Experiment を見つ ... Field . register_lookup ( AbsoluteValue ) これで、このクエリを使うことができるようになりました。 Experiment.objects.filter(change__abs=27) は次のSQLを生成します。 SELECT ... WHERE ABS ( "experiments" . "change" ) = 27 LookUp の代わりに Transform を使う ... ことで、それ以降のルックアップを連結できます。つまり、 Experiment.objects.filter(change__abs__lt=27) は以下のようなSQLを生成します。 SELECT ... WHERE ABS ( "experiments" . "change" ) < 27 他にルックアップが指定 ... ... 値モデルおよび変更 (start - end) を記録する Experiment モデルがあります。変化が一定の量に等しい ( Experiment.objects.filter(change__abs=27) )、またはそれが一定の量を超えなかった ( Experiment.objects.filter(change__abs__lt=27) ) すべての Experiment を見つ ... Field . register_lookup ( AbsoluteValue ) これで、このクエリを使うことができるようになりました。 Experiment.objects.filter(change__abs=27) は次のSQLを生成します。 SELECT ... WHERE ABS ( "experiments" . "change" ) = 27 LookUp の代わりに Transform を使う ... ことで、それ以降のルックアップを連結できます。つまり、 Experiment.objects.filter(change__abs__lt=27) は以下のようなSQLを生成します。 SELECT ... WHERE ABS ( "experiments" . "change" ) < 27 他にルックアップが指定 ... ... ementation is backwards compatible in that there isn't a need to assign the "view" permission to allow users who have the "change" permission to edit objects. There are a couple of backwards incompatible considerations . マイナーな機能 ¶ django.contrib ... elAdmin.sortable_by attribute and ModelAdmin.get_sortable_by() method allow limiting the columns that can be sorted in the change list page. The admin_order_field attribute for elements in ModelAdmin.list_display may now be a query expression. The new ... s() method allows customizing the deletion process of the delete view and the "delete selected" action. The actions.html , change_list_results.html , date_hierarchy.html , pagination.html , prepopulated_fields_js.html , search_form.html , and submit_li ... ... ementation is backwards compatible in that there isn't a need to assign the "view" permission to allow users who have the "change" permission to edit objects. There are a couple of backwards incompatible considerations . マイナーな機能 ¶ django.contrib ... elAdmin.sortable_by attribute and ModelAdmin.get_sortable_by() method allow limiting the columns that can be sorted in the change list page. The admin_order_field attribute for elements in ModelAdmin.list_display may now be a query expression. The new ... s() method allows customizing the deletion process of the delete view and the "delete selected" action. The actions.html , change_list_results.html , date_hierarchy.html , pagination.html , prepopulated_fields_js.html , search_form.html , and submit_li ... ... Transifex are incorporated. CVE-2018-16984: Password hash disclosure to "view only" admin users ¶ If an admin user has the change permission to the user model, only part of the password hash is displayed in the change form. Admin users with the view (b ... ut not change) permission to the user model were displayed the entire hash. While it's typically infeasible to reverse a strong password ... here files starting with a tilde or underscore weren't ignored by the migrations loader ( #29749 ). Made migrations detect changes to Meta.default_related_name ( #29755 ). Added compatibility for cx_Oracle 7 ( #29759 ). Fixed a regression in Django 2.0 ... ... Transifex are incorporated. CVE-2018-16984: Password hash disclosure to "view only" admin users ¶ If an admin user has the change permission to the user model, only part of the password hash is displayed in the change form. Admin users with the view (b ... ut not change) permission to the user model were displayed the entire hash. While it's typically infeasible to reverse a strong password ... here files starting with a tilde or underscore weren't ignored by the migrations loader ( #29749 ). Made migrations detect changes to Meta.default_related_name ( #29755 ). Added compatibility for cx_Oracle 7 ( #29759 ). Fixed a regression in Django 2.0 ... ... 管理アクション を参照してください。 ModelAdmin. actions_on_top ¶ ModelAdmin. actions_on_bottom ¶ Controls where on the admin changelist page the actions bar appears. By default, the admin changelist displays actions at the top of the page ( actions_on_to ... ないので、上記の宣言によって生成されるフォームはまったく同じフィールドを持つことになります。 ModelAdmin. fields ¶ "add" と "change" 上のフォームでシンプルなレイアウト変更 (有効なフィールドのみ表示、順序の変更、行のグルーピングなど) を行うには、 fields オ ... セットに表示します。その後に readonly_fields で定義されたフィールドを表示します。 ModelAdmin. fieldsets ¶ admin の "add" と "change" ページのレイアウトをコントロールするには、 fieldsets をセットしてください。 fieldsets は、2 値タプルのリストで、各 2 値タ ... ... 管理アクション を参照してください。 ModelAdmin. actions_on_top ¶ ModelAdmin. actions_on_bottom ¶ Controls where on the admin changelist page the actions bar appears. By default, the admin changelist displays actions at the top of the page ( actions_on_to ... ないので、上記の宣言によって生成されるフォームはまったく同じフィールドを持つことになります。 ModelAdmin. fields ¶ "add" と "change" 上のフォームでシンプルなレイアウト変更 (有効なフィールドのみ表示、順序の変更、行のグルーピングなど) を行うには、 fields オ ... セットに表示します。その後に readonly_fields で定義されたフィールドを表示します。 ModelAdmin. fieldsets ¶ admin の "add" と "change" ページのレイアウトをコントロールするには、 fieldsets をセットしてください。 fieldsets は、2 値タプルのリストで、各 2 値タ ... 2026年10月08日