Cleanup display messages
This commit is contained in:
parent
fadafbdee9
commit
0e8ee9a58f
|
@ -34,30 +34,12 @@ def seed_thing(cls):
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
db.session.bulk_insert_mappings(cls, things)
|
db.session.bulk_insert_mappings(cls, things)
|
||||||
# def seed_widgets():
|
|
||||||
# from app.widget import Widget
|
|
||||||
# widgets = [
|
|
||||||
# {
|
|
||||||
# 'name': 'Pizza Slicer',
|
|
||||||
# 'purpose': 'Cut delicious pizza',
|
|
||||||
# },
|
|
||||||
# {
|
|
||||||
# 'name': 'Rolling Pin',
|
|
||||||
# 'purpose': 'Roll delicious pizza',
|
|
||||||
# },
|
|
||||||
# {
|
|
||||||
# 'name': 'Pizza Oven',
|
|
||||||
# 'purpose': 'Bake delicious pizza',
|
|
||||||
# },
|
|
||||||
# ]
|
|
||||||
# db.session.bulk_insert_mappings(Widget, widgets)
|
|
||||||
|
|
||||||
|
|
||||||
class SeedCommand(Command):
|
class SeedCommand(Command):
|
||||||
""" Seed the DB."""
|
""" Seed the DB."""
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
if input('ARE YOU SURE YOU WANT TO DROP ALL TABLES AND RECREATE? (Y/N)\n'
|
if input('Are you sure you want to drop all tables and recreate? (y/N)\n'
|
||||||
).lower() == 'y':
|
).lower() == 'y':
|
||||||
print('Dropping tables...')
|
print('Dropping tables...')
|
||||||
db.drop_all()
|
db.drop_all()
|
||||||
|
|
|
@ -26,7 +26,7 @@ def init_db():
|
||||||
|
|
||||||
@manager.command
|
@manager.command
|
||||||
def drop_all():
|
def drop_all():
|
||||||
if input('ARE YOU SURE YOU WANT TO DROP ALL TABLES? (Y/N)\n').lower() == 'y':
|
if input('Are you sure you want to drop all tables? (y/N)\n').lower() == 'y':
|
||||||
print('Dropping tables...')
|
print('Dropping tables...')
|
||||||
db.drop_all()
|
db.drop_all()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user