Skip to content
This repository has been archived by the owner on Apr 17, 2018. It is now read-only.

Removing posts

Michael Webb edited this page Oct 25, 2017 · 1 revision

To remove a post:

  1. Run paster shell environment.ini where environment can be development, test, etc.

  2. Import the Link model: from r2.models import Link

  3. Get the ID of the post from its URL - e.g. http://host/ea/1c6/something-something means the post ID is 1c6

  4. Retrieve the Link object: link = Link._byID(int("1c6", 36))

  5. Double-check you have the right Link object: link.title

  6. Delete the link object: link._delete_from_db()