title: Object of type 'Decimal' is not JSON serializable Error when use request inherited object
body: <p>I have a strange problem with creation of shopping cart I in Django 2.0.
  Sopping cart is and object inherited from request and stored in session:</p>
  
  <pre><code>class Cart(object):
      def __init__(self, request, shop_u_id):
          self.session_key = str(settings.CART_SESSION_ID)
          self.session = request.session
          cart = self.session.get(self.session_key)
          if not cart:
              cart = self.session[self.session_key] = {}
          self.cart = cart
  </code></pre>
  
  <p>I have no problem with set and get methods, but strange problem 
  appeared in total sum function:</p>
  
  <pre><code>    def get_total_price(self):
          return sum(Decimal(item['price']) * item['quantity'] for item in self.cart.values())
  </code></pre>
  
  <p>I got an error: </p>
  
  <blockquote>
    <p>Object of type 'Decimal' is not JSON serializable</p>
  </blockquote>
  
  <p>But get_total_price nothing stores in session, it just for representation.  (item['price'] stored as string)</p>
  
  <p><a href="https://i.stack.imgur.com/9Kw9A.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9Kw9A.png" alt="enter image description here"></a></p>