Delete View

1
2
3
4
5
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("/")

More like this

  1. Owner required decorator by polarbear 4 years, 11 months ago
  2. JSON decorator for views handling ajax requests by anilshanbhag 5 months, 4 weeks ago
  3. EasyFeed class by limodou 6 years, 3 months ago
  4. LoginAsForm - Login as any User without a password by johnboxall 4 years ago
  5. Render Decorator by dahool 3 years, 9 months ago

Comments

(Forgotten your password?)