delete() function not working in 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))
......and these are my codes in 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>
 
     
     
    