per page, with , order by , clip by
Results of 1 - 4 of about 4 for Jane (0.006 sec.)
条件式 12297
条件式 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 ... e import date , timedelta >>> from django.db.models import Case , Value , When >>> Client . objects . create ( ... name = "Jane Doe" , ... account_type = Client . REGULAR , ... registered_on = date . today () - timedelta ( days = 36 ), ... ) >>> Clie ... M , then = Value ( "10%" )), ... default = Value ( "0%" ), ... ), ... ) . values_list ( "name" , "discount" ) <QuerySet [('Jane Doe', '0%'), ('James Smith', '5%'), ('Jack Black', '10%')]> Case() は任意の数の When() オブジェクトを引数として受け取ること ... ago , then = Value ( "5%" )), ... default = Value ( "0%" ), ... ) ... ) . values_list ( "name" , "discount" ) <QuerySet [('Jane Doe', '5%'), ('James Smith', '0%'), ('Jack Black', '10%')]> 注釈 条件は順番に評価されるので、上の例では2番目の条件がJane D ...
https://man.mtool.work/django/6.1/ref/models/conditional-expressions.html
メールを送信する 8820
メールを送信する Django provides wrappers for Python's email and smtplib modules to simplify composing and sending email. Django's email framework also supports swapping in different delivery mechanisms: you can direct email to the console ... () slightly more efficient. send_mail() with multiple to addresses sends a single email message, with john@example.com and jane@example.com both appearing in the "To:" field: send_mail ( "Subject" , "Message." , "from@example.com" , [ "john@example.c ... om" , "jane@example.com" ], ) send_mass_mail() sends a separate message per datatuple element, so john@example.com and jane@example.co ... "Subject" , "Message." , "from@example.com" , [ "john@example.com" ]), ( "Subject" , "Message." , "from@example.com" , [ "jane@example.com" ]), ) send_mass_mail ( datatuple ) mail_admins() mail_admins ( subject , message , * , fail_silently = False ...
https://man.mtool.work/django/6.1/topics/email.html
素の SQL 文の実行 8451
素の SQL 文の実行 Django gives you three ways of performing raw SQL queries: you can embed raw SQL fragments into ORM queries using RawSQL (see Raw SQL fragments ), use Manager.raw() to perform raw queries and return model instances , or av ... の SQL を実行できます: >>> for p in Person . objects . raw ( "SELECT * FROM myapp_person" ): ... print ( p ) ... John Smith Jane Jones この例はたいしてエキサイティングではありません。これは Person.objects.all() を実行したのと全く同じです。しかしながら ... # This will be retrieved by the original query ... p . last_name , # This will be retrieved on demand ... ) ... John Smith Jane Jones 見た目上は、そのクエリが名前と苗字を両方取得しているように見えます。しかし、この例は実際には 3 つのクエリを発行してい ...
https://man.mtool.work/django/6.1/topics/db/sql.html
組み込みテンプレートタグとフィルタ 7360
組み込みテンプレートタグとフィルタ このドキュメントでは、 Django の組み込みテンプレートタグとフィルタについて述べます。 また 自動ドキュメンテーション を使えばインストールされている組み込みタグとカスタムタグのドキュメントを読めるのでお勧めで ... キーワード引数を使って、テンプレートに追加のコンテキストを渡すことができます: {% include "name_snippet.html" with person = "Jane" greeting = "Hello" %} あらかじめ準備された変数だけを使って (あるいは変数をまったく使わずに) 出力させたい場合は only オプシ ...
https://man.mtool.work/django/6.1/ref/templates/builtins.html
PREV 1 NEXT