per page, with , order by , clip by
Results of 1 - 10 of about 113 for context (0.006 sec.)
クラスベースのジェネリックビュー: フラットインデックス 12347
クラスベースのジェネリックビュー: フラットインデックス この索引は、クラスベースビューのリファレンス文書を、異なる観点から編成したものです。ビューごとに、クラスツリーの有効な属性とメソッドが表されます。動作を定義するクラスの観点から編集された ... head() http_method_not_allowed() setup() TemplateView class TemplateView 属性 (とオプションのアクセサ): content_type extra_context http_method_names response_class [ render_to_response() ] template_engine template_name [ get_template_names() ] メソッド ... as_view() dispatch() get() get_context_data() head() http_method_not_allowed() render_to_response() setup() RedirectView class RedirectView 属性 (とオプションのア ... llowed() options() post() put() setup() 詳細ビュー DetailView class DetailView 属性 (とオプションのアクセサ): content_type context_object_name [ get_context_object_name() ] extra_context http_method_names model pk_url_kwarg query_pk_and_slug queryset [ ...
https://man.mtool.work/django/6.1/ref/class-based-views/flattened-index.html
Python プログラマーのための Django テンプレート言語 11742
Python プログラマーのための Django テンプレート言語 この文書は Django テンプレートシステムがどのように動作し、どのように拡張するか、技術的な観点から説明します。構文に関するリファレンスを探しているなら、 Django テンプレート言語 を参照してくだ ... ムを使うには3つのステップがあります: Engine を設定します。 テンプレートコードを Template にコンパイルします。 テンプレートを Context においてレンダリングします。 これらの各ステップで、Django プロジェクトは通常、テンプレートシステムの低レベルの API ではなく ... mplate を返します。 前のステップで取得した Template には render() メソッドがあり、コンテキストと場合によってはリクエストを Context に集約し、その下にある Template にレンダリングを委譲します。 エンジンを設定する もし DjangoTemplates バックエンドを使ってい ... 後述する属性のデフォルトは DjangoTemplates で渡されたもので上書きされます。 class Engine ( dirs = None , app_dirs = False , context_processors = None , debug = False , loaders = None , string_if_invalid = '' , file_charset = 'utf-8' , libraries = None , ...
https://man.mtool.work/django/6.1/ref/templates/api.html
独自のテンプレートタグとフィルタを作る 11275
独自のテンプレートタグとフィルタを作る Django のテンプレート言語は、アプリケーションのプレゼンテーションロジックのニーズに対応するように設計された、多種多様な 埋め込みタグやフィルタ を搭載しています。それでもなお、テンプレート構成要素のコア ... mat_html() を使うことを強く推奨します。 テンプレートタグの中からコンテキストにアクセスしたい場合、タグを登録する際に takes_context 引数を使うことでできるようになります。 @register . simple_tag ( takes_context = True ) def current_time ( context , format ... _string ): timezone = context [ "timezone" ] return your_get_current_time_method ( timezone , format_string ) 最初の引数は context に しなければならない ... ことに注意してください。 takes_context オプションがどのように動くかについて、詳しくは inclusion tag を参照してください。 タグの名前を変更する必要がある場合は、カ ...
https://man.mtool.work/django/6.1/howto/custom-template-tags.html
クラスベースのビューでミックスイン (mixin) を使用する 10064
クラスベースのビューでミックスイン (mixin) を使用する 注意 This is an advanced topic. A working knowledge of Django's class-based views is advised before exploring these techniques. Django のビルトインのクラスベースビューではたくさんの機能が ... mplateResponseMixin ) は、実際のオブジェクトを扱うときに、より柔軟なデフォルトを提供するためにこれをオーバーライドします。 ContextMixin Every built in view which needs context data, such as for rendering a template (including TemplateResponseMixin above ... ), should call get_context_data() passing any data they want to ensure is in there as keyword arguments. get_context_data() returns a dictionary; in ... its keyword arguments, but it is common to override this to add more members to the dictionary. You can also use the extra_context attribute. Django の一般的なクラスベースのビューを構築する Djangoのクラスベースのジェネリックビューが、個々の機能を提供する ...
https://man.mtool.work/django/6.1/topics/class-based-views/mixins.html
ジェネリック表示ビュー (Generic display view) 9547
ジェネリック表示ビュー (Generic display view) 以下の2つのクラスベースのジェネリックビューは、データを表示 (display) するために設計されています。多くのプロジェクトで、これらは最もよく使われるビューです。 DetailView class django.views.generic ... チャート setup() dispatch() http_method_not_allowed() get_template_names() get_slug_field() get_queryset() get_object() get_context_object_name() get_context_data() get() render_to_response() 例 myapp/views.py : from django.utils import timezone from dja ... tail import DetailView from articles.models import Article class ArticleDetailView ( DetailView ): model = Article def get_context_data ( self , ** kwargs ): context = super () . get_context_data ( ** kwargs ) context [ "now" ] = timezone . now () retur ... n context 例 myapp/urls.py : from django.urls import path from article.views import ArticleDetailView urlpatterns = [ path ( "<slug: ...
https://man.mtool.work/django/6.1/ref/class-based-views/generic-display.html
Django 1.8 リリースノート 8854
Django 1.8 リリースノート April 1, 2015 Django 1.8 へようこそ! このリリースノートでは、 バージョン 1.8 の新機能 と、Django 1.7 以前からアップグレードする際に注意すべき、 後方互換性のない変更 について説明します。 非推奨サイクルが終了した機能 ... ull 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 overriding only AdminSite.has_permission() and AdminSite ... .login_form . The base.html template has a new block usertools which contains the user-specific header. A new context variable has_permission , which gets its value from has_permission() , indicates whether the user may access the site. For ... e will now include a cache busting clause when getting the description of a table. E メール Email backends now support the context manager protocol for opening and closing connections. The SMTP email backend now supports keyfile and certfile authenticat ...
https://man.mtool.work/django/6.1/releases/1.8.html
組み込みのクラスベースのジェネリックビュー(汎用ビュー) 8664
組み込みのクラスベースのジェネリックビュー(汎用ビュー) ウェブアプリケーションを書くのは、特定のパターンを何度も繰り返すことになるため、単調になりがちです。Django はモデルとテンプレート層で単調さを取り除くことを試みてきましたが、ウェブ開発 ... かし、この名前でも良くないと感じるなら、コンテキストの変数名を手動で設定することもできます。次のように、ジェネリックビューの context_object_name 属性を設定すると、コンテキスト変数の名前として使えるようになります。 # views.py from django.views.generic impo ... rt ListView from books.models import Publisher class PublisherListView ( ListView ): model = Publisher context_object_name = "my_favorite_publishers" 分かりやすい context_object_name を設定するのはいつでも良い考えです。テンプレートの ... すが、テンプレートに必要な他の追加情報を使うにはどうすれば良いのでしょうか? その答えは、 DetailView をサブクラス化して、 get_context_data メソッドを自分で実装することです。デフォルトの実装では、単にテンプレートで表示されるオブジェクトだけを追加しますが、こ ...
https://man.mtool.work/django/6.1/topics/class-based-views/generic-display.html
データベースの計測 8627
データベースの計測 コードから発行されたクエリを理解して制御するために、Django は、データベースクエリの実行周辺にラッパー関数をインストールするためのフックを提供しています。たとえば、ラッパーは、クエリのカウント、クエリの実行時間の測定、クエ ... ビューでこのように使用します: from django.db import connection from django.shortcuts import render def my_view ( request ): context = { ... } # Code to generate context with all data. template_name = ... with connection . execute_wrapper ( blocker ): ret ... urn render ( request , template_name , context ) ラッパーに送られるパラメーターは以下の通りです: execute -- クエリを実行するために、残りのパラメータと一緒に呼び出される呼 ... te() なのか executemany() なのかを示す bool ( params が値のシーケンスなのか、値のシーケンスのシーケンスなのかを示します)。 context -- 呼び出しのコンテキストに関するデータを含む辞書。これにはコネクションとカーソルが含まれます。 このパラメータを使用するこ ...
https://man.mtool.work/django/6.1/topics/db/instrumentation.html
シンプルなミックスイン (mixin) 8198
シンプルなミックスイン (mixin) ContextMixin class django.views.generic.base. ContextMixin 属性 extra_context コンテキストに含める辞書。これは、 as_view() の中でコンテキストを指定する便利な方法です。使用例を次に示します。 from django.views.g ... eneric import TemplateView TemplateView . as_view ( extra_context = { "title" : "Custom Title" }) メソッド get_context_data ( ** kwargs ) テンプレートコンテキストを表す辞書を返します。与え ... られたキーワード引数は、返されるコンテキストを構成します。使用例を次に示します。 def get_context_data ( self , ** kwargs ): context = super () . get_context_data ( ** kwargs ) context [ "number" ] = random . randrange ( ... 1 , 100 ) return context すべてのクラスベースのジェネリックビューのテンプレートコンテキストには、 View インスタンスを指す view 変数が含まれています ...
https://man.mtool.work/django/6.1/ref/class-based-views/mixins-simple.html
Django 1.3 リリースノート 8198
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 ... ntinue to use the base unittest library, you can -- you just won't get any of the nice new unittest2 features. Transaction context managers Users of Python 2.5 and above may now use transaction management functions as context managers. For example: with ... de set null, set default, set to any value, protect, or do nothing. For more information, see the on_delete documentation. Contextual markers and comments for translatable strings For translation strings with ambiguous meaning, you can now use the pgett ... ext function to specify the context of the string. And if you just want to add some information for translators, you can also add special translator comments ...
https://man.mtool.work/django/6.1/releases/1.3.html
PREV 1 2 3 4 5 6 7 8 9 10 NEXT