Skip to content

Instantly share code, notes, and snippets.

@vkotovv
Created August 20, 2013 14:08
Show Gist options
  • Save vkotovv/6281951 to your computer and use it in GitHub Desktop.
Save vkotovv/6281951 to your computer and use it in GitHub Desktop.
Clear data for all tables via flask-sqlalchemy
def clear_data(session):
meta = db.metadata
for table in reversed(meta.sorted_tables):
print 'Clear table %s' % table
session.execute(table.delete())
session.commit()
@NailClaros
Copy link

what is the session datatype?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment