porridger/back/delete_all_poems.py

8 lines
177 B
Python

from .orm_models import Poems
from .db import database
all_poems = database.query(Poems).all()
for to_delete in all_poems:
database.delete(to_delete)
database.commit()