title: AJAX unable to define the key's method in Django
body: <p>First off, sorry for the odd phrasing of the title. </p>
  
  <p>I currently have a webapp that allows users to order food from a resturant. In the menu html I currently have the following snippet. </p>
  
  <pre><code>{% if latest_order %}
  &lt;table class="table" id="checkout-table"&gt;
    &lt;thead class="thead-dark"&gt;
      &lt;tr&gt;
        &lt;th scope="col"&gt;&lt;/th&gt;
        &lt;th scope="col"&gt;YOUR&lt;/th&gt;
        &lt;th scope="col"&gt;CART&lt;/th&gt;
        &lt;th scope="col"&gt;&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
    {% for order in latest_order %}
    &lt;tr&gt;
      &lt;td&gt;{{ order.order_name }}&lt;/td&gt;
      &lt;td class="change-quantity"&gt;
        &lt;form method="post"&gt;
          {% csrf_token %}
          &lt;div class="row"&gt;
            &lt;div class="col-sm"&gt;
              &lt;button type="submit" name="remove_quantity" value="{{ order.id }}"
              class="mr-3 btn btn-outline-info"&gt;-&lt;/button&gt;
            &lt;/div&gt;
            &lt;div class="col-sm"&gt;
              {{ order.order_quantity }}
            &lt;/div&gt;
            &lt;div class="col-sm"&gt;
              &lt;button type="submit" name="add_quantity" value="{{ order.id }}" class="ml-3 btn 
              btn-outline-info"&gt;+&lt;/button&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/form&gt;
      &lt;/td&gt;
      &lt;td&gt;${{ order.order_individual_price }}&lt;/td&gt;
  </code></pre>
  
  <p>in my JS I have the following AJAX code running</p>
  
  <pre><code>    $(document).ready(function(){
      $(".ramen").click(function(event){
          event.preventDefault()
          var serializedData = $("#ramen-form").serialize()
  
          $.ajax({
              url: $("ramen-form").data("url"),
              data: serializedData,
              type: 'post',
              success: function(response) {
                  $("#checkout-table").append('&lt;tr&gt;&lt;td&gt;' + response.new_order.order_name + '&lt;/td&gt;&lt;td class="change-quantity"&gt;' +
                                              '&lt;form method="post"&gt;{% csrf_token %}&lt;div class="row"&gt;&lt;div class="col-sm"&gt;' +
                                              '&lt;button type="submit" name="remove_quantity" value="{{ order.id }}"class="mr-3 btn btn-outline-info"&gt;-&lt;/button&gt;' +
                                              '&lt;/div&gt;&lt;div class="col-sm"&gt;'+ response.new_order.order_quantity +'&lt;/div&gt;&lt;div class="col-sm"&gt;' +
                                              '&lt;button type="submit" name="add_quantity" value="{{ order.id }}" class="ml-3 btn btn-outline-info"&gt;+&lt;/button&gt;' +
                                              '&lt;/div&gt;&lt;/div&gt;&lt;/form&gt;&lt;/td&gt;&lt;td&gt;$'+ response.new_order.order_individual_price +'&lt;/td&gt;&lt;form method="post"&gt;{% csrf_token %}&lt;th&gt;' +
                                              '&lt;button type="submit" name="delete" value="{{ order.id }}" class="btn btn-danger"&gt;Delete Item&lt;/button&gt;&lt;/th&gt;&lt;/form&gt;&lt;/tr&gt;')
              }
          })
      });
  })
  </code></pre>
  
  <p>In my views.py I have the following to return a JsonResponse</p>
  
  <pre><code>         get_price = menu_name.Menu_price
           get_desc = menu_name.Menu_Desc
           new_order = Order.objects.create(
              customer=request.user, 
              order_name=menu_name, 
              order_individual_price=get_price, 
              order_default_price=get_price,
              order_desc = get_desc,
              )
            return JsonResponse({'new_order':model_to_dict(new_order)}, status=200)
  </code></pre>
  
  <p>AJAX returns the following error after I try to add an item to cart</p>
  
  <p><a href="https://i.stack.imgur.com/005it.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/005it.png" alt="enter image description here"></a></p>