def _populator(): from kotti import DBSession from kotti.resources import Document from kotti.populate import populate populate() for doc in DBSession.query(Document)[1:]: DBSession.delete(doc) transaction.commit()