Django. How to reduce total number of coupons after each use
问题 Hey guys I am learning to develop a ecommerce website, I have a coupon model with used and max_value, which take care of max number of coupon available to use, I want to implement that in my views, such that if the coupon is redeemed more than the max_value(number of coupons), then it should show an error message. Whatever I have tried with my limited knowledge is resulting in errors. How can I increment the 'used' in views? This is in much more understandable way: users(sellers) are able to