delete() method in Django

If you want to delete an object, you can do it from the object instance using the delete() method. Ex:.

  • post = Posts.objects.get(id=1)
  • post.delete()

Comments

Popular posts from this blog

Internationalization (Language Setting) in Django

reverse_lazy() Method in Django

CharFilter in Django