django rest framework business logic
class CoffeeShopService(object):
@staticmethod
def place_order(quantity):
# do the business logic here
return order_id
django rest framework business logic
class CoffeeShopService(object):
@staticmethod
def place_order(quantity):
# do the business logic here
return order_id
django rest framework business logic
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')
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us