def flushentities(foreign_id): """Delete all entities from given collection.""" collection = Collection.by_foreign_id(foreign_id) if collection is None: raise ValueError("No such collection: %r" % foreign_id) delete_entities(collection.id) db.session.commit()
def flushentities(foreign_id): """Delete all entities from given collection.""" collection = get_collection(foreign_id) delete_entities(collection.id) db.session.commit()