BrickTracker/bricktracker/views/index.py

22 lines
649 B
Python
Raw Normal View History

2025-01-17 11:03:00 +01:00
from flask import Blueprint, render_template
from .exceptions import exception_handler
from ..minifigure_list import BrickMinifigureList
from ..set_status_list import BrickSetStatusList
from ..set_list import BrickSetList, set_metadata_lists
2025-01-17 11:03:00 +01:00
index_page = Blueprint('index', __name__)
# Index
@index_page.route('/', methods=['GET'])
@exception_handler(__file__)
def index() -> str:
return render_template(
'index.html',
brickset_collection=BrickSetList().last(),
2025-02-03 16:46:45 +01:00
brickset_statuses=BrickSetStatusList.list(),
2025-01-31 16:34:52 +01:00
minifigure_collection=BrickMinifigureList().last(),
**set_metadata_lists(as_class=True)
2025-01-17 11:03:00 +01:00
)