title: How to send data-pk value from editable to server in django
body: <p>How can I send the data-pk from editable to server. I have already used both params and source but it is not working. Please help me solve with this situation. I think <code>$('#customer_name').attr('data-pk')</code> is not working in <code>pk</code> but when I alert it have value, and I don't understand</p>
  
  <pre><code>$('#customer_name').editable({
              type: 'text',
              pk: $('#customer_name').attr('data-pk'),
              url: '{% url 'change_customer_inline' %}',
              title: 'Enter customer name',
              success: function (response, newValue) {
  
                  if (!response) {
                      return "Unknown error!"
                  }
                  if (response.success === false) {
                      return respond.msg;
                  }
  
                  $.ajax({
                      method: "POST",
                      url: '{% url 'change_customer_inline' %}',
                      dataType: 'JSON',
                      data: {
                          'csrfmiddlewaretoken': $('input[name="csrfmiddlewaretoken"]').val(),
                          'customer_id': $('#customer_name').attr('data-pk'),
                      },
                      responseTime: 200,
                      response: function (settings) {
                          if (settings.data.value) {
                              this.responseText = '{"success": true}';
                          } else {
                              this.responseText = '{"success": false, "msg": "required"}';
                          }
                      }
                  });
              }
          });
  </code></pre>
  
  <p>view.py</p>
  
  <pre><code>def change_customer_inline(request):
  if request.method == 'POST':
      try:
          if request.is_ajax():
              customer_id = request.POST.get('customer_id')
              customer = Customer.objects.get(pk=customer_id)
              if request.POST.get('customer_name'):
                  customer.name = request.POST.get('customer_name')
                  customer.save()
      except OSError as e:
          error = messages.add_message(request, messages.ERROR, e, extra_tags='change_customer_inline')
          HttpResponse(error)
  return render_to_response('order_list.html')
  </code></pre>