Views.py
def delete(request):
customer = Customer.objects.get(id=5)
customer.delete()
return HttpResponse('deleted')
Template.py
<form method="POST" action="/customer/">
<div style="float: right;
margin: 0px; padding: 05px; ">
<p> Name : <select name ="delete_user">
{% for customer in customer %}
<option value = "{{ customer }}"> {{ customer.name }} </option>
{% endfor %}
</select>
</p>
<p><input type="submit" value="delete"></p>
</div><br />
urls.py
(r'^delete/$','quote.excel.views.delete'),
This isnot working,it needs to ftch users from database ,in drop down box ,when i select a particular user and click delete,it should delete the name.
This is the error,i m getting
DoesNotExist at /delete/
Customer matching query does not exist.