per page, with , order by , clip by
Results of 1 - 2 of about 2 for discount (0.001 sec.)
条件式 — Django 6.1 ドキュメント 11228
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 ... ccount_type = Client . PLATINUM , ... registered_on = date . today () - timedelta ( days = 10 * 365 ), ... ) >>> # Get the discount for each Client based on the account type >>> Client . objects . annotate ( ... discount = Case ( ... When ( account_type ... t_type = Client . PLATINUM , then = Value ( "10%" )), ... default = Value ( "0%" ), ... ), ... ) . values_list ( "name" , "discount" ) <QuerySet [('Jane Doe', '0%'), ('James Smith', '5%'), ('Jack Black', '10%')]> Case() は任意の数の When() オブジェクトを ... _ago = date . today () - timedelta ( days = 30 ) >>> a_year_ago = date . today () - timedelta ( days = 365 ) >>> # Get the discount for each Client based on the registration date >>> Client . objects . annotate ( ... discount = Case ( ... When ( register ...
https://man.mtool.work/django/6.1/ref/models/conditional-expressions.html
条件式 — Django 6.1 ドキュメント 7485
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 ... ccount_type = Client . PLATINUM , ... registered_on = date . today () - timedelta ( days = 10 * 365 ), ... ) >>> # Get the discount for each Client based on the account type >>> Client . objects . annotate ( ... discount = Case ( ... When ( account_type ... t_type = Client . PLATINUM , then = Value ( "10%" )), ... default = Value ( "0%" ), ... ), ... ) . values_list ( "name" , "discount" ) <QuerySet [('Jane Doe', '0%'), ('James Smith', '5%'), ('Jack Black', '10%')]> Case() は任意の数の When() オブジェクトを ... _ago = date . today () - timedelta ( days = 30 ) >>> a_year_ago = date . today () - timedelta ( days = 365 ) >>> # Get the discount for each Client based on the registration date >>> Client . objects . annotate ( ... discount = Case ( ... When ( register ...
https://man.mtool.work/django/6.1/ref/models/conditional-expressions.html
PREV 1 NEXT