Commits

Audrius Kažukauskas  committed 841c721

Add cleardb command to manage.py

  • Participants
  • Parent commits 2fbc10b

Comments (0)

Files changed (1)

 from flask.ext.assets import ManageAssets
 
 from beancounter import create_app
-from beancounter.model import init_db
+from beancounter.model import init_db, clear_db
 
 manager = Manager(create_app)
 manager.add_option('-c', '--config', type=abspath, dest='config_filename',
         init_db()
 
 
+@manager.command
+def cleardb():
+    """Clear database."""
+    with current_app.app_context():
+        clear_db()
+
+
 if __name__ == '__main__':
     manager.run()