def delete_view(request,object_id,model):
	obj = get_object_or_404(model,id=object_id)
	obj.delete()
	request.user.message_set.create(message='The %s was deleted' % model._meta.verbose_name )
	return HttpResponseRedirect("/")