mirror of
https://github.com/godotengine/godot-showreel-voting.git
synced 2026-09-03 18:15:13 +03:00
Added cli command to create new showreel
This commit is contained in:
11
main.py
11
main.py
@@ -61,6 +61,17 @@ def create_app(config=None):
|
|||||||
# Commands
|
# Commands
|
||||||
# ------------------------------------------------
|
# ------------------------------------------------
|
||||||
|
|
||||||
|
@app.cli.command('create-showreel')
|
||||||
|
@click.argument("name")
|
||||||
|
def create_showreel(name):
|
||||||
|
if not name:
|
||||||
|
print('Showreel name is required.')
|
||||||
|
return
|
||||||
|
showreel = Showreel(status=ShowreelStatus.CLOSED, title=name)
|
||||||
|
DB.session.add(showreel)
|
||||||
|
DB.session.commit()
|
||||||
|
print(f'Created showreel: {name} (ID: {showreel.id})')
|
||||||
|
|
||||||
@app.cli.command('create-sample-data')
|
@app.cli.command('create-sample-data')
|
||||||
def create_sample_data():
|
def create_sample_data():
|
||||||
if current_app.config['ENV'] != 'dev':
|
if current_app.config['ENV'] != 'dev':
|
||||||
|
|||||||
Reference in New Issue
Block a user