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