def order(request, quantity=1): # Process the order by calling the mapped method order_id = CoffeeShopService.place_order(quantity) return HttpResponse({'order_id': order_id, mimetype='application/json')
class CoffeeShopService(object): @staticmethod def place_order(quantity): # do the business logic here return order_id