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

Messages Framework in Django

Forms in Django(bound, unbound, clean, is_valid, errors)

Advantages to using URLField() over TextField()