... Author ) class AuthorAdmin ( admin . ModelAdmin ): pass 1 つ以上のモデルが与えられ、 ModelAdmin に登録されます。カスタムの AdminSite を使用している場合、 site キーワード引数を使って渡してください: from django.contrib import admin from .models import Autho ... イトインスタンスを返す呼び出し可能オブジェクトへのドット区切りのインポートパスです。デフォルトは 'django.contrib.admin.sites.AdminSite' です。使い方は デフォルトの admin サイトをオーバーライドする を参照してください。 autodiscover () [ソース] この関数は、イ ... されます。 通常、この機能を手動で呼び出す必要はありません。Django が開始するとき AdminConfig が呼び出してくれます。 カスタム AdminSite を使用している場合、通常はすべての ModelAdmin サブクラスをコードにインポートし、それらをカスタム AdminSite に登録します。そ ... ... ッド) add template filter add() (cache のメソッド) (GeometryCollection のメソッド) (RelatedManager のメソッド) add_action() (AdminSite のメソッド) add_arguments() (BaseCommand のメソッド) (DiscoverRunner のクラスメソッド) add_constraint() (BaseDatabaseSchem ... AdminEmailHandler (django.utils.log のクラス) AdminPasswordChangeForm (django.contrib.auth.forms のクラス) ADMINS setting AdminSite (django.contrib.admin のクラス) AdminUserCreationForm (django.contrib.auth.forms のクラス) aearliest() (django.db.models.q ... pop() (backends.base.SessionBase のメソッド) app_directories.Loader (django.template.loaders のクラス) app_index_template (AdminSite の属性) app_label (ContentType の属性) (Options の属性) app_name (ResolverMatch の属性) app_names (ResolverMatch の属性) A ... ... etion confirmation page. The jQuery library embedded in the admin has been upgraded to version 1.11.2. You can now specify AdminSite.site_url in order to display a link to the front-end site. You can now specify ModelAdmin.show_full_result_count to contro ... l whether or not the full count of objects should be displayed on a filtered admin page. The AdminSite.password_change() method now has an extra_context parameter. You can now control who may login to the admin site by overri ... ding only AdminSite.has_permission() and AdminSite.login_form . The base.html template has a new block usertools which contains the user-speci ... ... 理が必要になります。 このビューの作成は、読者にとっての演習課題として残されています。 アクションをサイト全体で利用可能にする AdminSite. add_action ( action , name = None ) [ソース] アクションによっては、管理サイトの すべての オブジェクトで利用できるようにす ... 最適なものもあります。上記で定義したエクスポートアクションはその良い候補でしょう。アクションをグローバルに利用可能にするには AdminSite.add_action() を使います。たとえば: from django.contrib import admin admin . site . add_action ( export_selected_objects ) ... ローバルに利用可能になります。後でプログラム的に アクションを削除する 場合に備えてアクションに明示的に名前を付けたい場合は、 AdminSite.add_action() へ第二引数を渡します: admin . site . add_action ( export_selected_objects , "export_selected" ) アクションを無 ... ... r Formset . マイナーな機能 django.contrib.admin The admin/base.html template now has a new block header which contains the admin site header. The new ModelAdmin.get_formset_kwargs() method allows customizing the keyword arguments passed to the constructor ... w has a quick filter toolbar. The new context variable model which contains the model class for each model is added to the AdminSite.each_context() method. The new ModelAdmin.search_help_text attribute allows specifying a descriptive text for the search b ... of STATIC_URL , the leading slash is removed from that setting (now 'static/' ) in the default startproject template. The AdminSite method for the admin index view is no longer decorated with never_cache when accessed directly, rather than via the recomm ... ... hly unlikely. Features deprecated in 1.1 One feature has been marked as deprecated in Django 1.1: You should no longer use AdminSite.root() to register that admin views. That is, if your URLconf contains the line: ( r "^admin/(.*)" , admin . site . root ) ... r "^admin/" , include ( admin . site . urls )), You should begin to remove use of this feature from your code immediately. AdminSite.root will raise a PendingDeprecationWarning if used in Django 1.1. This warning is hidden by default. In Django 1.2, this ... warning will be upgraded to a DeprecationWarning , which will be displayed loudly. Django 1.3 will remove AdminSite.root() entirely. For more details on our deprecation policies and strategy, see Django のリリースプロセス . Django 1.1 の新 ... ... 。 詳細については、 choices に関するモデルフィールドのリファレンス を確認してください。 マイナーな機能 django.contrib.admin AdminSite.get_log_entries() メソッドが追加され、サイトのリストされたログエントリのクエリセットをカスタマイズすることができるようにな ... えるようになりました。 XRegExp がバージョン 3.2.0 から 5.1.1 にアップグレードされました。 指定されたモデルの管理クラスを返す AdminSite.get_model_admin() メソッドが追加されました。 ModelAdmin.list_display のプロパティが boolean 属性をサポートするようになりま ... なくなりました。 Now データベース関数は、Oracle上で CURRENT_TIMESTAMP の代わりに LOCALTIMESTAMP を使用するようになりました。 AdminSite.site_header は、 <h1> タグの代わりに <div> タグでレンダリングされるようになりました。スクリーンリーダーを使用するユーザーは ... ... #23983 ). Restored the pre_migrate signal if all apps have migrations ( #23975 ). Made admin system checks run for custom AdminSite s ( #23497 ). Ensured the app registry is fully populated when unpickling models. When an external script (like a queueing ... ... うになりました。 現在のユーザーが使用可能なアプリケーションのリストを値として持つ available_apps コンテキスト変数が、新たに AdminSite.each_context() メソッドに追加されました。 AdminSite.empty_value_display および ModelAdmin.empty_value_display が追加され、 ... , ] polls/urls.py app_name = "polls" # added urlpatterns = [ ... ] This change also means that the old way of including an AdminSite instance is deprecated. Instead, pass admin.site.urls directly to django.conf.urls.url() : urls.py from django.conf.urls i ... ... sitional setting allows specifying the default hashing algorithm to use for encoding cookies, password reset tokens in the admin site, user sessions, and signatures created by django.core.signing.Signer and django.core.signing.dumps() . Support for SHA-25 ... now has a sidebar on larger screens for easier navigation. It is enabled by default but can be disabled by using a custom AdminSite and setting AdminSite.enable_nav_sidebar to False . Rendering the sidebar requires access to the current request in order ... 2026年10月08日