per page, with , order by , clip by
Results of 1 - 10 of about 108 for else (0.007 sec.)
条件式 — Django 6.1 ドキュメント 11890
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » 条件式 ¶ Conditional expressions let you use if ... elif ... else logic within filters, annotations, aggregations, and updates. A conditional expres ... hen ( Q ( then = 0 ), then = 1 ) Case ¶ class Case ( * cases , ** extra ) [ソース] ¶ Case() 式は Python の if ... elif ... else 文のようなものです。指定された When() オブジェクトの各 condition は 1 つが True と評価されるまで順番に評価されます。一致し ... 件がJane DoeとJack Blackの両方にマッチしても正しい結果が得られることを覚えておいてください。これは Python の if ... elif ... else 文と同じように動作します。 case() は filter() 句でも使えます。たとえば、1ヶ月以上前に登録されたゴールドクライアントと1年以 ... データベースでは、これは CASE ステートメントを使ってエミュレートされます: SELECT count ( CASE WHEN account_type = 1 THEN id ELSE null ) as regular , count ( CASE WHEN account_type = 2 THEN id ELSE null ) as gold , count ( CASE WHEN account_type = 3 TH ...
https://man.mtool.work/django/6.1/ref/models/conditional-expressions.html
条件式 — Django 6.1 ドキュメント 11890
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » 条件式 ¶ Conditional expressions let you use if ... elif ... else logic within filters, annotations, aggregations, and updates. A conditional expres ... hen ( Q ( then = 0 ), then = 1 ) Case ¶ class Case ( * cases , ** extra ) [ソース] ¶ Case() 式は Python の if ... elif ... else 文のようなものです。指定された When() オブジェクトの各 condition は 1 つが True と評価されるまで順番に評価されます。一致し ... 件がJane DoeとJack Blackの両方にマッチしても正しい結果が得られることを覚えておいてください。これは Python の if ... elif ... else 文と同じように動作します。 case() は filter() 句でも使えます。たとえば、1ヶ月以上前に登録されたゴールドクライアントと1年以 ... データベースでは、これは CASE ステートメントを使ってエミュレートされます: SELECT count ( CASE WHEN account_type = 1 THEN id ELSE null ) as regular , count ( CASE WHEN account_type = 2 THEN id ELSE null ) as gold , count ( CASE WHEN account_type = 3 TH ...
https://man.mtool.work/django/6.1/ref/models/conditional-expressions.html
"sites" フレームワーク — Django 6.1 ドキュメント 10563
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » "sites" フレームワーク ¶ Django にはオプションで "sites" フレームワークが付属しています。これは、オブジェクトや機能を特定の Web サイトに関連付けるた ... ます。たとえば: from django.conf import settings def my_view ( request ): if settings . SITE_ID == 3 : # Do something. pass else : # Do something else. pass It's fragile to hardcode the site IDs like that, in case they change. The cleaner way of accom ... _view ( request ): current_site = get_current_site ( request ) if current_site . domain == "foo.com" : # Do something pass else : # Do something else. pass これには、サイトフレームワークがインストールされているかどうかを確認するという利点もあります。 ... out_request (): current_site = Site . objects . get_current () if current_site . domain == "foo.com" : # Do something pass else : # Do something else. pass 表示用の現在のドメインを取得する ¶ LJWorld.com と Lawrence.com はどちらも、ニュースが発生したと ...
https://man.mtool.work/django/6.1/ref/contrib/sites.html
Sprint quickstart guide — Django 6.1 ドキュメント 9772
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » Sprint quickstart guide ¶ This document explains how to prepare to contribute to Django. It is intended for use during sprints, or by people who are ... ush the branch to your fork and open a pull request. See Submitting contributions for the full process. Continuing someone else's work ¶ If you're continuing the work from someone else's pull request on GitHub, things can be tricky. You need to pull ... ssing tickets Methods to find tickets Claiming a ticket Creating a branch for the ticket Starting fresh Continuing someone else's work 前のトピックへ 新しいコントリビューターへのアドバイス 次のトピックへ Contributing code 関連キーワード ticket tests ...
https://man.mtool.work/django/6.1/internals/contributing/sprint-quickstart.html
Sprint quickstart guide — Django 6.1 ドキュメント 9517
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » Sprint quickstart guide ¶ This document explains how to prepare to contribute to Django. It is intended for use during sprints, or by people who are ... ush the branch to your fork and open a pull request. See Submitting contributions for the full process. Continuing someone else's work ¶ If you're continuing the work from someone else's pull request on GitHub, things can be tricky. You need to pull ... ssing tickets Methods to find tickets Claiming a ticket Creating a branch for the ticket Starting fresh Continuing someone else's work 前のトピックへ 新しいコントリビューターへのアドバイス 次のトピックへ Contributing code 関連キーワード ticket xf git ...
https://man.mtool.work/django/6.1/internals/contributing/sprint-quickstart.html
"sites" フレームワーク — Django 6.1 ドキュメント 9517
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » "sites" フレームワーク ¶ Django にはオプションで "sites" フレームワークが付属しています。これは、オブジェクトや機能を特定の Web サイトに関連付けるた ... ます。たとえば: from django.conf import settings def my_view ( request ): if settings . SITE_ID == 3 : # Do something. pass else : # Do something else. pass It's fragile to hardcode the site IDs like that, in case they change. The cleaner way of accom ... _view ( request ): current_site = get_current_site ( request ) if current_site . domain == "foo.com" : # Do something pass else : # Do something else. pass これには、サイトフレームワークがインストールされているかどうかを確認するという利点もあります。 ... out_request (): current_site = Site . objects . get_current () if current_site . domain == "foo.com" : # Do something pass else : # Do something else. pass 表示用の現在のドメインを取得する ¶ LJWorld.com と Lawrence.com はどちらも、ニュースが発生したと ...
https://man.mtool.work/django/6.1/ref/contrib/sites.html
ファイルのアップロード — Django 6.1 ドキュメント 8726
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » ファイルのアップロード ¶ Django がファイルアップロードを扱うとき、ファイルデータは request.FILES に格納されます ( request についての詳細は リクエスト ... if form . is_valid (): handle_uploaded_file ( request . FILES [ "file" ]) return HttpResponseRedirect ( "/success/url/" ) else : form = UploadFileForm () return render ( request , "upload.html" , { "form" : form }) ここで、 request.FILES をフォームの ... , request . FILES ) if form . is_valid (): # file is saved form . save () return HttpResponseRedirect ( "/success/url/" ) else : form = ModelFormWithFileField () return render ( request , "upload.html" , { "form" : form }) 手動でオブジェクトを作成す ... ithFileField ( file_field = request . FILES [ "file" ]) instance . save () return HttpResponseRedirect ( "/success/url/" ) else : form = UploadFileForm () return render ( request , "upload.html" , { "form" : form }) リクエストの外で手動でオブジェクト ...
https://man.mtool.work/django/6.1/topics/http/file-uploads.html
ファイルのアップロード — Django 6.1 ドキュメント 8458
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » ファイルのアップロード ¶ Django がファイルアップロードを扱うとき、ファイルデータは request.FILES に格納されます ( request についての詳細は リクエスト ... if form . is_valid (): handle_uploaded_file ( request . FILES [ "file" ]) return HttpResponseRedirect ( "/success/url/" ) else : form = UploadFileForm () return render ( request , "upload.html" , { "form" : form }) ここで、 request.FILES をフォームの ... , request . FILES ) if form . is_valid (): # file is saved form . save () return HttpResponseRedirect ( "/success/url/" ) else : form = ModelFormWithFileField () return render ( request , "upload.html" , { "form" : form }) 手動でオブジェクトを作成す ... ithFileField ( file_field = request . FILES [ "file" ]) instance . save () return HttpResponseRedirect ( "/success/url/" ) else : form = UploadFileForm () return render ( request , "upload.html" , { "form" : form }) リクエストの外で手動でオブジェクト ...
https://man.mtool.work/django/6.1/topics/http/file-uploads.html
Djangoの認証システムを使用する — Django 6.1 ドキュメント 8190
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » Djangoの認証システムを使用する ¶ このドキュメントでは、デフォルト設定でのDjangoの認証システムの使用方法を説明します。この設定は、タスクの適切な範囲を ... thenticate ( username = "john" , password = "secret" ) if user is not None : # A backend authenticated the credentials ... else : # No backend authenticated the credentials ... request はオプションで、 HttpRequest のインスタンスを取ります。このインス ... icated を用いて次のように識別できます。 if request . user . is_authenticated : # Do something for authenticated users. ... else : # Do something for anonymous users. ... 非同期ビューでは次のようになります。 user = await request . auser () if user . i ... s_authenticated : # Do something for authenticated users. ... else : # Do something for anonymous users. ... ユーザーをログインさせる方法 ¶ 現在のセッションに接続したい認証ユーザーがいる場合 ...
https://man.mtool.work/django/6.1/topics/auth/default.html
Djangoの認証システムを使用する — Django 6.1 ドキュメント 8190
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » Djangoの認証システムを使用する ¶ このドキュメントでは、デフォルト設定でのDjangoの認証システムの使用方法を説明します。この設定は、タスクの適切な範囲を ... thenticate ( username = "john" , password = "secret" ) if user is not None : # A backend authenticated the credentials ... else : # No backend authenticated the credentials ... request はオプションで、 HttpRequest のインスタンスを取ります。このインス ... icated を用いて次のように識別できます。 if request . user . is_authenticated : # Do something for authenticated users. ... else : # Do something for anonymous users. ... 非同期ビューでは次のようになります。 user = await request . auser () if user . i ... s_authenticated : # Do something for authenticated users. ... else : # Do something for anonymous users. ... ユーザーをログインさせる方法 ¶ 現在のセッションに接続したい認証ユーザーがいる場合 ...
https://man.mtool.work/django/6.1/topics/auth/default.html
PREV 1 2 3 4 5 6 7 8 9 10 NEXT