Example #1
0
    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')
Example #2
0
def drop_collections():
    from openspending.model.mongo import drop_collections
    log.info("Dropping all collections in database...")
    drop_collections()
    log.info("Done!")
Example #3
0
 def _cmd_dropcollections(self):
     self._check_args_length(1)
     from openspending.model.mongo import drop_collections
     drop_collections()
Example #4
0
def clean_db():
    from openspending.model import mongo
    mongo.drop_collections()