BrickTracker/bricktracker/reload.py

40 lines
1.1 KiB
Python
Raw Normal View History

from .instructions_list import BrickInstructionsList
from .retired_list import BrickRetiredList
2025-01-31 16:34:52 +01:00
from .set_owner_list import BrickSetOwnerList
2025-02-04 12:52:18 +01:00
from .set_purchase_location_list import BrickSetPurchaseLocationList
from .set_status_list import BrickSetStatusList
2025-02-03 16:46:45 +01:00
from .set_storage_list import BrickSetStorageList
2025-01-31 18:08:53 +01:00
from .set_tag_list import BrickSetTagList
from .theme_list import BrickThemeList
# Reload everything related to a database after an operation
def reload() -> None:
# Failsafe
try:
# Reload the instructions
BrickInstructionsList(force=True)
2025-01-31 16:34:52 +01:00
# Reload the set owners
BrickSetOwnerList.new(force=True)
2025-01-31 16:34:52 +01:00
2025-02-04 12:52:18 +01:00
# Reload the set purchase locations
BrickSetPurchaseLocationList.new(force=True)
# Reload the set statuses
BrickSetStatusList.new(force=True)
2025-02-03 16:46:45 +01:00
# Reload the set storages
BrickSetStorageList.new(force=True)
2025-01-31 18:08:53 +01:00
# Reload the set tags
BrickSetTagList.new(force=True)
2025-01-31 18:08:53 +01:00
# Reload retired sets
BrickRetiredList(force=True)
# Reload themes
BrickThemeList(force=True)
except Exception:
pass