django rest framework business logic

Solutions on MaxInterview for django rest framework business logic by the best coders in the world

showing results for - "django rest framework business logic"
Lotta
18 Oct 2019
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')
Dante
05 Jan 2019
1    class CoffeeShopService(object):
2        @staticmethod
3        def place_order(quantity):
4           # do the business logic here
5           return order_id