per page, with , order by , clip by
Results of 1 - 10 of about 22 for endif (0.014 sec.)
組み込みテンプレートタグとフィルタ 13383
組み込みテンプレートタグとフィルタ このドキュメントでは、 Django の組み込みテンプレートタグとフィルタについて述べます。 また 自動ドキュメンテーション を使えばインストールされている組み込みタグとカスタムタグのドキュメントを読めるのでお勧めで ... var2 var3 %} 上のコードは以下と等価です: {% if var1 %} {{ var1 }} {% elif var2 %} {{ var2 }} {% elif var3 %} {{ var3 }} {% endif %} また、渡された変数がすべて False の場合のフォールバック値として、リテラル文字列を使うこともできます: {% firstof var1 va ... hlete_list %} < li > {{ athlete.name }} </ li > {% endfor %} {% else %} < li > Sorry, no athletes in this list. </ li > {% endif %} </ ul > if {% if %} タグは変数を評価し、その変数が "true" であるとき (すなわち変数が存在し、空ではなく、その値が False ... ength }} {% elif athlete_in_locker_room_list %} Athletes should be out of the locker room soon! {% else %} No athletes. {% endif %} 上の例では、 athlete_list が空でなければ、アスリートの人数を {{ athlete_list|length }} 変数で表示します。 例にもあるよう ...
https://man.mtool.work/django/6.1/ref/templates/builtins.html
ジェネリック日付ビュー 12087
ジェネリック日付ビュー 日付ベースのジェネリックビュー ( django.views.generic.dates 内で提供されています) は、日付ベースのデータのために、ドリルダウンページを描画するためのビューです。 注釈 このページの例のいくつかは、 myapp/models.py 内で下 ... .title }} </ li > {% endfor %} </ ul > < p > {% if previous_month %} Previous Month: {{ previous_month | date :"F Y" }} {% endif %} {% if next_month %} Next Month: {{ next_month | date :"F Y" }} {% endif %} </ p > WeekArchiveView class WeekArchiveView ... l > < p > {% if previous_week %} Previous Week: {{ previous_week | date :"W" }} of year {{ previous_week | date :"Y" }} {% endif %} {% if previous_week and next_week %} -- {% endif %} {% if next_week %} Next week: {{ next_week | date :"W" }} of year { ... { next_week | date :"Y" }} {% endif %} </ p > この例では週番号を出力しています。 テンプレートフィルタの date が 'W' フォーマット文字列で計算した週番号は、 str ...
https://man.mtool.work/django/6.1/ref/class-based-views/generic-date-based.html
メッセージフレームワーク 9865
メッセージフレームワーク Web アプリケーションでは非常に一般的に、フォームやその他のユーザーインプットのプロセスの後、ユーザーに向けて一過性の通知メッセージ ("フラッシュメッセージ" とも言われます) を表示する必要があります。 Django は、anonym ... es %} < ul class = "messages" > {% for message in messages %} < li {% if message.tags %} class = " {{ message.tags }} " {% endif %} > {{ message }} </ li > {% endfor %} </ ul > {% endif %} コンテキストプロセッサーを使っている場合、テンプレートは Reque ... es %} < ul class = "messages" > {% for message in messages %} < li {% if message.tags %} class = " {{ message.tags }} " {% endif %} > {% if message.level == DEFAULT_MESSAGE_LEVELS.ERROR %} Important: {% endif %} {{ message }} </ li > {% endfor %} </ u ... l > {% endif %} テンプレート以外では 、 get_messages() を使うことができます: from django.contrib.messages import get_messages storage = ...
https://man.mtool.work/django/6.1/ref/contrib/messages.html
サイトマップ・フレームワーク 9865
サイトマップ・フレームワーク Djangoには、 sitemap XML ファイルを作成するための高レベルなサイトマップ生成フレームワークが付属しています。 概要 サイトマップとは、検索エンジンのインデクサーに、ページの変更頻度や、あるページがサイト内の他のペー ... et %} <url> <loc> {{ url.location }} </loc> {% if url.lastmod %} <lastmod> {{ url.lastmod | date :"Y-m-d" }} </lastmod> {% endif %} {% if url.changefreq %} <changefreq> {{ url.changefreq }} </changefreq> {% endif %} {% if url.priority %} <priority> {{ ... url.priority }} </priority> {% endif %} <news:news> {% if url.item.publication_date %} <news:publication_date> {{ url.item.publication_date | date :"Y-m-d" }} ... </news:publication_date> {% endif %} {% if url.item.tags %} <news:keywords> {{ url.item.tags }} </news:keywords> {% endif %} </news:news> </url> {% endfor % ...
https://man.mtool.work/django/6.1/ref/contrib/sitemaps.html
フォームを使う 9679
フォームを使う このドキュメントについて このドキュメントでは、Web フォームの基本と、それらを Django で扱う方法を紹介しています。より詳しく知りたいときは、フォーム API の特定の領域、 フォーム API 、 フォーム フィールド または フォームとフィー ... > {% for error in form.subject.errors %} < li >< strong > {{ error | escape }} </ strong ></ li > {% endfor %} </ ol > {% endif %} 非フィールドエラー(および/または form.as_p() のようなヘルパーを使用したときにフォームの先頭にレンダリングされる隠しフィ ... {% if field.help_text %} < p class = "help" id = " {{ field.auto_id }} _helptext" > {{ field.help_text | safe }} </ p > {% endif %} </ div > {% endfor %} {{ field }} の有用な属性は次のとおりです: {{ field.errors }} このフィールドに対応するバリデーショ ... しては特に有用ではありませんが、以下のような条件テストに役立ちます。 {% if field.is_hidden %} {# Do something special #} {% endif %} {{ field.label }} The label of the field, e.g. Contact email . {{ field.label_tag }} フィールドのラベルは、適切なHTMLの ...
https://man.mtool.work/django/6.1/topics/forms/
Djangoの認証システムを使用する 9494
Djangoの認証システムを使用する このドキュメントでは、デフォルト設定でのDjangoの認証システムの使用方法を説明します。この設定は、タスクの適切な範囲を管理することで、最も一般的なプロジェクトのニーズにかなうよう徐々に発展してきました。そして、パ ... ml" %} {% block content %} {% if form.errors %} < p > Your username and password didn't match. Please try again. </ p > {% endif %} {% if next %} {% if user.is_authenticated %} < p > Your account doesn't have access to this page. To proceed, please lo ... gin with an account that has access. </ p > {% else %} < p > Please login to see this page. </ p > {% endif %} {% endif %} < form method = "post" action = " {% url 'login' %} " > {% csrf_token %} < table > < tr > < td > {{ form.us ... Welcome, {{ user.username }} . Thanks for logging in. </ p > {% else %} < p > Welcome, new user. Please log in. </ p > {% endif %} RequestContext が使用されていない場合、このテンプレートコンテキスト変数は無効となります。 パーミッション 現在ログイン中 ...
https://man.mtool.work/django/6.1/topics/auth/default.html
ページ分割 (Pagination) 9124
ページ分割 (Pagination) Django は、ページ分割 (ページネーション) されたデータを管理するための高レベルと低レベルの方法を提供しています。つまり、"前へ/次へ" リンクを持つ、複数のページに分割されたデータです。 Paginator クラス 内部では、ページ分 ... < a href = "?page=1" > &laquo; first </ a > < a href = "?page= {{ page_obj.previous_page_number }} " > previous </ a > {% endif %} < span class = "current" > Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }} . </ span > {% if page_obj. ... e_obj.next_page_number }} " > next </ a > < a href = "?page= {{ page_obj.paginator.num_pages }} " > last &raquo; </ a > {% endif %} </ span > </ div > Paginator をビュー関数で使用する 以下は、queryset をページ分割するビュー関数内の Paginator の一例です ...
https://man.mtool.work/django/6.1/topics/pagination.html
Django 4.2 リリースノート 8198
Django 4.2 リリースノート 2023年4月3日 Django 4.2 へようこそ! このリリースノートでは、 バージョン 4.2 の新機能 と、Django 4.1 以前からアップグレードする際に注意すべき、 後方互換性のない変更 について説明します。また、 一部の機能を非推奨 とし ... ルターは、 length と == 演算子を {% if %} タグ内で使用する形式に置き換えられました。例えば {% if value | length == 4 %} … {% endif %} {% if value | length == 4 %} True {% else %} False {% endif %} これは以下の表記に代わるものです: {% if value | length_i ... s : 4 %} … {% endif %} {{ value | length_is : 4 }} django.contrib.auth.hashers.SHA1PasswordHasher , django.contrib.auth.hashers.UnsaltedSHA1Pa ...
https://man.mtool.work/django/6.1/releases/4.2.html
Django 5.0 リリースノート 8198
Django 5.0 リリースノート 2023年12月4日 Django 5.0 へようこそ! このリリースノートでは、 バージョン 5.0 の新機能 と、Django 4.2 以前からアップグレードする際に注意すべき、 後方互換性のない変更 について説明します。また、 一部の機能を非推奨 とし ... _text %} < div class = "helptext" id = " {{ form.name.auto_id }} _helptext" > {{ form.name.help_text | safe }} </ div > {% endif %} {{ form.name.errors }} {{ form.name }} < div class = "row" > < div class = "col" > {{ form.email.label_tag }} {% if for ... ext %} < div class = "helptext" id = " {{ form.email.auto_id }} _helptext" > {{ form.email.help_text | safe }} </ div > {% endif %} {{ form.email.errors }} {{ form.email }} </ div > < div class = "col" > {{ form.password.label_tag }} {% if form.passwo ... < div class = "helptext" id = " {{ form.password.auto_id }} _helptext" > {{ form.password.help_text | safe }} </ div > {% endif %} {{ form.password.errors }} {{ form.password }} </ div > </ div > </ div > ... </ form > これを、以下のように簡略化できる ...
https://man.mtool.work/django/6.1/releases/5.0.html
Django テンプレート言語 8013
Django テンプレート言語 このドキュメントはDjangoテンプレートシステムの文法を説明しています。もしあなたがもっと技術者的な観点でどう動かすかやどう拡張するかを知りたい場合は、 Python プログラマーのための Django テンプレート言語 を参照してくださ ... ength }} {% elif athlete_in_locker_room_list %} Athletes should be out of the locker room soon! {% else %} No athletes. {% endif %} 上記の場合、 athlete_list が空でなければ、 {{ athlete_list|length }} 変数によって選手の数が表示されます。もし athlete_i ... | length > 1 %} Team: {% for athlete in athlete_list %} ... {% endfor %} {% else %} Athlete: {{ athlete_list.0.name }} {% endif %} 上の例はうまくいきますが、ほとんどのテンプレートフィルタは文字列を返すので、フィルタを使った数学的な比較は通常は期待通り ... ンプレートは title ブロックの内容を常に上書きします: {% if change_title %} {% block title %} Hello! {% endblock title %} {% endif %} 最後に、同じテンプレート内で同じ名前の block タグを複数定義することはできないことに留意してください。この制限は、block ...
https://man.mtool.work/django/6.1/ref/templates/language.html
PREV 1 2 3 NEXT