per page, with , order by , clip by
Results of 1 - 10 of about 115 for type (0.013 sec.)
条件式 12355
条件式 Conditional expressions let you use if ... elif ... else logic within filters, annotations, aggregations, and updates. A conditional expression evaluates a series of conditions for each row of a table and returns the matching result ... を使用します: from django.db import models class Client ( models . Model ): REGULAR = "R" GOLD = "G" PLATINUM = "P" ACCOUNT_TYPE_CHOICES = { REGULAR : "Regular" , GOLD : "Gold" , PLATINUM : "Platinum" , } name = models . CharField ( max_length = 50 ) ... registered_on = models . DateField () account_type = models . CharField ( max_length = 1 , choices = ACCOUNT_TYPE_CHOICES , default = REGULAR , ) When class When ( condition ... import F , Q , When >>> # String arguments refer to fields; the following two examples are equivalent: >>> When ( account_type = Client . GOLD , then = "name" ) >>> When ( account_type = Client . GOLD , then = F ( "name" )) >>> # You can use field l ...
https://man.mtool.work/django/6.1/ref/models/conditional-expressions.html
ウィジェット 11627
ウィジェット ウィジェットは、Django が HTML の input 要素の表現方法です。ウィジェットは、HTML のレンダリングをコントロールして、ウィジェットに合致する GET/POST ディクショナリからデータを取り出します。 Built-in widgets によって作られる HTML ... は、 <!DOCTYPE html> を対象とした HTML5 シンタックスを使います。たとえば、XHTML スタイルである checked='checked' よりも、 checked といった ... グが適用され、CSS クラスや追加の属性はありません。 >>> f = CommentForm ( auto_id = False ) >>> print ( f ) <div>Name:<input type="text" name="name" required></div> <div>Url:<input type="url" name="url" required></div> <div>Comment:<input type="text" n ... 素を、名前用のウィジェットには特別な CSS クラスを指定したいかもしれません。また、HTML5 の異なる入力タイプを使用するために、 'type' 属性を指定することも可能です。これを行うには、ウィジェットを作成する際に Widget.attrs 引数を使用します。 class CommentFor ...
https://man.mtool.work/django/6.1/ref/forms/widgets.html
索引 11539
索引 記号 | _ | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | ア | イ | ク | コ | シ | ス | テ | ハ | ヒ | フ | メ | モ | ロ | 具 | 国 | 環 | 翻 | 表 | 言 | 長 記号 -- dbshell コマン ... inspectdb コマンドラインオプション loaddata コマンドラインオプション migrate コマンドラインオプション remove_stale_contenttypes コマンドラインオプション showmigrations コマンドラインオプション sqlflush コマンドラインオプション sqlmigrate コマンドライ ... コマンドラインオプション --include-partitions inspectdb コマンドラインオプション --include-stale-apps remove_stale_contenttypes コマンドラインオプション --include-views inspectdb コマンドラインオプション --indent dumpdata コマンドラインオプション -- ... メソッド) app_directories.Loader (django.template.loaders のクラス) app_index_template (AdminSite の属性) app_label (ContentType の属性) (Options の属性) app_name (ResolverMatch の属性) app_names (ResolverMatch の属性) AppCommand (django.core.manageme ...
https://man.mtool.work/django/6.1/genindex.html
フォーム API 11438
フォーム API このドキュメントについて このドキュメントでは、Django のフォーム API の詳細について説明します。このドキュメントを読む前に フォームについての概要 を読むことをおすすめします。 バインドされた (bound) フォームとバインドされていない ... arField () ... >>> f = CommentForm ( initial = { "name" : "instance" }, auto_id = False ) >>> print ( f ) <div>Name:<input type="text" name="name" value="instance" required></div> <div>Url:<input type="url" name="url" required></div> <div>Comment:<in ... put type="text" name="comment" required></div> Form. get_initial_for_field ( field , field_name ) フォームフィールドの初期データを返 ... の表示方法を変更できます。 >>> f . as_div () . split ( "</div>" )[ 0 ] '<div><label for="id_subject">Subject:</label><input type="text" name="subject" maxlength="100" required id="id_subject">' >>> f [ "subject" ] . label = "Topic" >>> f . as_div () . ...
https://man.mtool.work/django/6.1/ref/forms/api.html
フォームセット (Formset) 8852
フォームセット (Formset) class BaseFormSet [ソース] フォームセットは、同じページで複数のフォームを扱うための抽象レイヤーです。データグリッドに例えるとわかりやすいでしょう。次のようなフォームがあるとしましょう: >>> from django import forms > ... ArticleFormSet () >>> for form in formset : ... print ( form ) ... <div><label for="id_form-0-title">Title:</label><input type="text" name="form-0-title" id="id_form-0-title"></div> <div><label for="id_form-0-pub_date">Pub date:</label><input type=" ... ... } ... ] ... ) >>> for form in formset : ... print ( form ) ... <div><label for="id_form-0-title">Title:</label><input type="text" name="form-0-title" value="Django is now open source" id="id_form-0-title"></div> <div><label for="id_form-0-pub_da ... te">Pub date:</label><input type="text" name="form-0-pub_date" value="2023-02-11" id="id_form-0-pub_date"></div> <div><label for="id_form-1-title">Title:</ ...
https://man.mtool.work/django/6.1/topics/forms/formsets.html
contenttypes フレームワーク 8764
contenttypes フレームワーク Django には contenttypes アプリケーションが含まれており、 Django を使ったプロジェクトにインストールされているすべてのモデルを追跡し、モデルを扱うための高レベルで汎用的なインターフェースを提供します。 概要 content ... types アプリケーションの中心にあるのは、 django.contrib.contenttypes.models.ContentType にある ContentType モデルです。 ContentType のインスタンスは、プロジェクトにインストールされたモデルに ... 関する情報を表し、格納します。新しい ContentType のインスタンスは、新しいモデルがインストールされるたびに自動的に作成されます。 ContentType のインスタンスは ContentType が ... 表すモデルクラスを返すメソッドと、それらのモデルからオブジェクトを問い合わせるメソッドを持っています。また、 ContentType を操作するためのメソッドや、特定のモデルの ContentType のインスタンスを取得するためのメソッドを追加する カスタムマネージャ ...
https://man.mtool.work/django/6.1/ref/contrib/contenttypes.html
クラスベースのジェネリックビュー: フラットインデックス 8174
クラスベースのジェネリックビュー: フラットインデックス この索引は、クラスベースビューのリファレンス文書を、異なる観点から編成したものです。ビューごとに、クラスツリーの有効な属性とメソッドが表されます。動作を定義するクラスの観点から編集された ... dispatch() 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 ... not_allowed() 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 que ... se() setup() リストビュー ListView class ListView 属性 (とオプションのアクセサ): allow_empty [ get_allow_empty() ] content_type context_object_name [ get_context_object_name() ] extra_context http_method_names model ordering [ get_ordering() ] pagina ...
https://man.mtool.work/django/6.1/ref/class-based-views/flattened-index.html
リクエストとレスポンスのオブジェクト 7885
リクエストとレスポンスのオブジェクト 簡単な概要 Django は、システムを通じてステータスを渡すために、リクエストとレスポンスのオブジェクトを使います。 あるページがリクエストされたとき、Django はリクエストに関するメタデータを含んだ HttpRequest ... を使用します。フォームデータが DEFAULT_CHARSET エンコーディングでないことがわかっている場合に便利です。 HttpRequest. content_type リクエストの MIME タイプを表す文字列です。 CONTENT_TYPE から識別されます。 HttpRequest. content_params CONTENT_TYPE ヘッダ ... です。 HttpRequest. FILES FILES は、アップロードされた全てのファイルを含む辞書型のオブジェクトです。 FILES の各キーは <input type="file" name=""> の name から成ります。 FILES の各値は UploadedFile です。 詳細については、 ファイルの管理 を参照してくださ ... い。 FILES には、リクエストメソッドが POST で、リクエストに投稿した <form> に enctype="multipart/form-data" が設定されていた場合にのみデータが含まれます。それ以外の場合、 FILES は空の辞書のようなオブジェクトに ...
https://man.mtool.work/django/6.1/ref/request-response.html
クラスベースのビューでフォームを扱う 7546
クラスベースのビューでフォームを扱う フォームの処理には、一般に3つの場合分けが存在します。 最初の GET リクエスト (空白またはデフォルト値が埋め込まれたフォームを返す) 無効なデータの POST リクエスト (よくあるパターンは、エラー表示を追加したフ ... は True を返します。 クライアントの優先度を考慮して正しいフォーマットを判断するには、 django.http.HttpRequest.get_preferred_type() を使用してください。 class JsonableResponseMixin : """ Mixin to add JSON support to a form. Must be 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_t ... ype ( self . accepted_media_types ) is None : # No format in common. return HttpResponse ( status_code = 406 , headers = { "Accept" : "," . join ( self . a ...
https://man.mtool.work/django/6.1/topics/class-based-views/generic-editing.html
配信 (syndication) フィード フレームワーク 7496
配信 (syndication) フィード フレームワーク Django には、 RSS と Atom フィードを作成するための高レベルな配信 (syndication) フィード生成フレームワークが付属しています。 任意の配信フィードを作成するには、短い Python クラスを書くだけで済みます。 ... ォルトでは、このフレームワークで作成されたフィードはRSS 2.0を使用します。 これを変更するには、次のように Feed クラスに feed_type 属性を追加します: from django.utils.feedgenerator import Atom1Feed class MyFeed ( Feed ): feed_type = Atom1Feed feed_type ... アイテムごとに1つのエンクロージャのみを持つ場合は代わりに item_enclosure_url 、 item_enclosure_length 、 item_enclosure_mime_type フックを使用します。使用例については、以下の ExampleFeed クラスを参照してください。 言語 Feeds created by the syndication ... フィードの Atom 版と RSS 版の 両方 を利用したい開発者もいるでしょう。そのためには、 Feed クラスのサブクラスを作成し、 feed_type を別のものに設定します。それから URLconf を更新して、追加バージョンを追加します。 すべての例を示します: from django.contri ...
https://man.mtool.work/django/6.1/ref/contrib/syndication.html
PREV 1 2 3 4 5 6 7 8 9 10 NEXT