per page, with , order by , clip by
Results of 1 - 10 of about 21 for dispatch (0.003 sec.)
クラスベースのジェネリックビュー: フラットインデックス 13801
クラスベースのジェネリックビュー: フラットインデックス この索引は、クラスベースビューのリファレンス文書を、異なる観点から編成したものです。ビューごとに、クラスツリーの有効な属性とメソッドが表されます。動作を定義するクラスの観点から編集された ... ています。 シンプルなジェネリックビュー View class View 属性 (とオプションのアクセサ): http_method_names メソッド as_view() dispatch() head() http_method_not_allowed() setup() TemplateView class TemplateView 属性 (とオプションのアクセサ): content_type ext ... od_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 属 ... ンのアクセサ): http_method_names pattern_name permanent query_string url [ get_redirect_url() ] メソッド as_view() delete() dispatch() get() head() http_method_not_allowed() options() post() put() setup() 詳細ビュー DetailView class DetailView 属性 (とオプ ...
https://man.mtool.work/django/6.1/ref/class-based-views/flattened-index.html
シグナル 12177
シグナル Django には "シグナルディスパッチャ" があり、フレームワークの他の場所でアクションが発生したときに、ほかのアプリケーションが通知を受けるのを助けてくれます。簡単に言うと、シグナルは特定の 送り手 が、あるアクションが発生したことを一連 ... のすべてのレシーバ関数は、登録された順番に1つずつ呼び出されます。 Signal. connect ( receiver , sender = None , weak = True , dispatch_uid = None ) [ソース] パラメータ : receiver -- このシグナルに接続されるコールバック関数です。詳しくは レシーバ関数 を参照し ... local function, it may be garbage collected. To prevent this, pass weak=False when you call the signal's connect() method. dispatch_uid -- シグナルが重複して送信される可能性がある場合の、シグナル受信機の一意な識別子。詳しくは 重複したシグナルを防止する を ... ドカードキーワード引数です。 下記がデコレーターとの繋げ方です: from django.core.signals import request_finished from django.dispatch import receiver @receiver ( request_finished ) def my_receiver ( sender , ** kwargs ): print ( "Request finished!" ) Now, ...
https://man.mtool.work/django/6.1/topics/signals.html
クラスベースビュー入門 10283
クラスベースビュー入門 クラスベースビューはビューを実装するもう一つの手段で、関数の代わりに Python のオブジェクトとしてビューを定義します。クラスベースビューは関数ベースのビューを完全に置き換えるものではありませんが、関数ベースのビューと比較 ... view() クラスメソッドがあります。この関数はクラスのインスタンスを作成し、 setup() を呼び出してその属性を初期化し、次にその dispatch() メソッドを呼び出します。 dispatch はリクエストを調べて、それが GET 、 POST などであるかを判断し、定義されている場合は一致 ... ーのすべてのインスタンスをデコレーションするには、クラスの定義自体をデコレーションする必要があります。そのためには、クラスの dispatch() メソッドにデコレータを付けます。 クラス上のメソッドはスタンドアロンの関数と完全に同じではないため、関数デコレータを単純に ... TemplateView class ProtectedView ( TemplateView ): template_name = "secret.html" @method_decorator ( login_required ) def dispatch ( self , * args , ** kwargs ): return super () . dispatch ( * args , ** kwargs ) あるいは、より簡潔に、クラスを代わりにデコ ...
https://man.mtool.work/django/6.1/topics/class-based-views/intro.html
ベース・ビュー 9725
ベース・ビュー 以下の3つのクラスは、Django のビューの作成に必要な多くの機能を提供します。これらは Django ビューの 親の ビューとみなすことができ、それ自体で使うことも継承して使うこともできます。プロジェクトに必要な全ての機能を提供するわけでは ... 。厳密にはジェネリックビューではないので、 django.views からインポートすることもできます。 メソッドのフローチャート setup() dispatch() http_method_not_allowed() options() Example views.py : from django.http import HttpResponse from django.views import Vie ... Lパターンからキャプチャされた位置引数および/またはキーワード引数 をそれぞれ args および kwargs 属性に割り当てます。その後、 dispatch() が呼び出されます。 ビューのサブクラスが非同期 ( async def ) メソッドハンドラを定義している場合、 as_view() は返された呼び ... 両方が1つのビュークラスで定義されている場合、 ImproperlyConfigured 例外が発生します。 setup ( request , * args , ** kwargs ) dispatch() の前に、ビューの初期化のための重要な処理を実行します。 ビューの request 属性には HttpRequest を割り当て、 URLパターンから ...
https://man.mtool.work/django/6.1/ref/class-based-views/base.html
非同期サポート 9048
非同期サポート Django has support for writing asynchronous ("async") views, along with an entirely async-enabled request stack if you are running under ASGI . Async views will still work under WSGI, but with a small per-request adaptation c ... hod_decorator() can be used with asynchronous methods, including async def view handlers. Note, though, that if decorating dispatch() on a View with asynchronous handlers, you will need to override dispatch to make it async def as well: class MyClass ( V ... iew ): @method_decorator ( never_cache ) async def dispatch ( self , * args , ** kwargs ): return await super () . dispatch ( * args , ** kwargs ) async def get ( self , request ): . ... .. async def post ( self , request ): ... Here, because we are decorating dispatch , rather than the individual handler methods, we need to make dispatch asynchronous so that method_decorator can correctly ...
https://man.mtool.work/django/6.1/topics/async.html
ジェネリック表示ビュー (Generic display view) 8389
ジェネリック表示ビュー (Generic display view) 以下の2つのクラスベースのジェネリックビューは、データを表示 (display) するために設計されています。多くのプロジェクトで、これらは最もよく使われるビューです。 DetailView class django.views.generic ... seDetailView django.views.generic.detail.SingleObjectMixin django.views.generic.base.View メソッドのフローチャート setup() dispatch() http_method_not_allowed() get_template_names() get_slug_field() get_queryset() get_object() get_context_object_name() ge ... BaseListView django.views.generic.list.MultipleObjectMixin django.views.generic.base.View メソッドのフローチャート setup() dispatch() http_method_not_allowed() get_template_names() get_queryset() get_context_object_name() get_context_data() get() render_ ...
https://man.mtool.work/django/6.1/ref/class-based-views/generic-display.html
Pythonモジュール索引 8287
Pythonモジュール索引 a | c | d | f | h | m | s | t | u | v a django.apps c django.conf django.conf.urls django.conf.urls.i18n django.contrib django.contrib.admin Django's admin site. django.contrib.admindocs Django's admin documentation gen ... els.options Model meta-class layer django.db.models.signals Signals sent by the model system. django.db.transaction django.dispatch Signal dispatch f django.forms django.forms.fields Django's built-in form fields. django.forms.formsets Django's functions ...
https://man.mtool.work/django/6.1/py-modindex.html
Porting your apps from Django 0.96 to 1.0 8101
Porting your apps from Django 0.96 to 1.0 Django 1.0 breaks compatibility with 0.96 in some areas. This guide will help you port 0.96 projects and apps to 1.0. The first part of this document includes the common changes needed to run with 1 ... ndlers. Connect, disconnect, and send signals via methods on the Signal object instead of through module methods in django.dispatch.dispatcher . Remove any use of the Anonymous and Any sender options; they no longer exist. You can still receive signals s ... ent by any sender by using sender=None Make any custom signals you've declared into instances of django.dispatch.Signal instead of anonymous objects. Here's quick summary of the code changes you'll need to make: Old (0.96) New (1.0) de ... f callback(sender) def callback(sender, **kwargs) sig = object() sig = django.dispatch.Signal() dispatcher.connect(callback, sig) sig.connect(callback) dispatcher.send(sig, sender) sig.send(sender) dispatcher. ...
https://man.mtool.work/django/6.1/releases/1.0-porting-guide.html
クラスベースのビューでフォームを扱う 8016
クラスベースのビューでフォームを扱う フォームの処理には、一般に3つの場合分けが存在します。 最初の GET リクエスト (空白またはデフォルト値が埋め込まれたフォームを返す) 無効なデータの POST リクエスト (よくあるパターンは、エラー表示を追加したフ ... used with an object-based FormView (e.g. CreateView). """ accepted_media_types = [ "text/html" , "application/json" ] def dispatch ( self , request , * args , ** kwargs ): if request . get_preferred_type ( self . accepted_media_types ) is None : # No fo ... HttpResponse ( status_code = 406 , headers = { "Accept" : "," . join ( self . accepted_media_types )} ) return super () . dispatch ( request , * args , ** kwargs ) def form_invalid ( self , form ): response = super () . form_invalid ( form ) accepted_ty ...
https://man.mtool.work/django/6.1/topics/class-based-views/generic-editing.html
ファイルのアップロード 7814
ファイルのアップロード Django がファイルアップロードを扱うとき、ファイルデータは request.FILES に格納されます ( request についての詳細は リクエスト/レスポンス オブジェクト を参照してください)。ここでは、ファイルがどのようにディスクとメモリに ... st ) @csrf_protect def _upload_file_view ( request ): # Process request ... クラスベースのビューを使用している場合は、その dispatch() メソッドで csrf_exempt() を使用し、実際にリクエストを処理するメソッドで csrf_protect() を使用する必要があります。下記はコ ... import View from django.views.decorators.csrf import csrf_exempt , csrf_protect @method_decorator ( csrf_exempt , name = "dispatch" ) class UploadFileView ( View ): def setup ( self , request , * args , ** kwargs ): request . upload_handlers . insert ( ...
https://man.mtool.work/django/6.1/topics/http/file-uploads.html
PREV 1 2 3 NEXT