title: Open / Edit / Save record in Django Form
body: <p>Currently i have a Django Form where i can add a new customer to the database. I also have a table showing all customers currently in this database. Now i would like to click on a customer name in the customer table to open the existing customer and have the option to edit the record and save.</p>
  
  <p>Below is my current code parts, if more is needed please ask. </p>
  
  <p>my navbar.html </p>
  
  <pre><code>&lt;li&gt;&lt;a href='{% url "customeradd" %}'&gt;New Customer&lt;/a&gt;&lt;/li&gt;
  </code></pre>
  
  <p>my urls.py</p>
  
  <pre><code>url(r'^customeradd/$', 'customer.views.customeradd', name='customeradd'),
  </code></pre>
  
  <p>my views.py</p>
  
  <pre><code>def customeradd(request): 
      form = CustomerAddForm(request.POST or None)
  
      if request.method == 'POST': 
          if form.is_valid():
              save_it = form.save(commit=False)
              save_it.save()
              messages.success(request, 'Customer added succesfully')
              return HttpResponseRedirect('/customeroverview/')
          else:
              messages.error(request, 'Customer save error, please check fields below')
      else:
          form = CustomerAddForm()
  
  
      return render_to_response("customer-add.html",
                                {"customer_add_form": form},
                                context_instance=RequestContext(request))
  </code></pre>
  
  <p>customeroverview.html which shows table of all customers (only three fields showing)</p>
  
  <pre><code>&lt;td&gt;&lt;a href='{% url "customeradd" %}'&gt;{{ customer.customer_name }}&lt;/a&gt;&lt;/td&gt;
  &lt;td&gt;{{ customer.customer_type }}&lt;/td&gt;
  &lt;td&gt;{{ customer.customer_address }}&lt;/td&gt;
  </code></pre>
  
  <p>So now i can click on the customer name in the customer table and the CustomerAddForm will open. Offcourse in the current situation empty as no arguments are given. </p>
  
  <ol>
  <li><p>How would i pass the customer.id field as argument when clicking on the customer.customer_name hyperlink in the customeroverview.html?</p></li>
  <li><p>How would i catch this customer.id in the view - how should urls.py look like?</p></li>
  <li><p>When the form is opened with the existing customer.id, how should i save the current record instead of creating a new customer.id</p></li>
  </ol>
  
  <p>Any help / suggestions on this situation would be very helpful in my understanding of Django GET / POST.</p>