... 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 ... ... 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 ... 2026年10月08日