def dropdb(self): if config.get('openspending.sandbox_mode') != 'true': abort(403, "Deleting the database is not permitted unless in sandbox mode") return from openspending.model import mongo mongo.drop_collections() return render('dataset/dropdb.html')
def drop_collections(): from openspending.model.mongo import drop_collections log.info("Dropping all collections in database...") drop_collections() log.info("Done!")
def _cmd_dropcollections(self): self._check_args_length(1) from openspending.model.mongo import drop_collections drop_collections()
def clean_db(): from openspending.model import mongo mongo.drop_collections()