delete() 函数在 Django 中不起作用,
def delete_hardware (request):
notice = ''
inventory = get_object_or_404(inventory, id = request.GET.get('id'))
if inventory:
inventory.delete()
notice = "Hardware was deleted"
return render_to_response('form.html', {'notice': notice},
context_instance=RequestContext(request))
......这些是我在 form.html 中的代码
<td bgcolor='#f1f1f1'><a onclick="javascript:confirmDelete('/delete/?id={{id}}')">
<img src='{{ MEDIA_URL }}/images/delete.png' width=25 height=25 />
</a></td>