Load MySQL connection from config file.
This commit is contained in:
@@ -74,10 +74,10 @@ def show_episode_dialog(builder: Gtk.Builder, title: str, season_id: int, episod
|
|||||||
# Update Date of the Episode
|
# Update Date of the Episode
|
||||||
cal_value = builder.get_object('episode_calendar').get_date()
|
cal_value = builder.get_object('episode_calendar').get_date()
|
||||||
selected_date = datetime(*cal_value).date()
|
selected_date = datetime(*cal_value).date()
|
||||||
episode.update(date=selected_date,
|
episode.date = selected_date,
|
||||||
number=str(builder.get_object("episode_no_spin_button").get_value()),
|
episode.number = int(builder.get_object("episode_no_spin_button").get_value())
|
||||||
name=builder.get_object("episode_name_entry").get_text())\
|
episode.name = builder.get_object("episode_name_entry").get_text()
|
||||||
.execute()
|
episode.save()
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
@@ -117,7 +117,7 @@ def show_edit_death_dialog(builder: Gtk.Builder, episode_id: int, death: sql.Dea
|
|||||||
dialog.set_transient_for(builder.get_object("main_window"))
|
dialog.set_transient_for(builder.get_object("main_window"))
|
||||||
with sql.db.atomic():
|
with sql.db.atomic():
|
||||||
if death:
|
if death:
|
||||||
index = util.Util.get_index_of_combo_model(builder.get_object('edit_death_enemy_combo'), 0, death.enemy.id)
|
index = util.get_index_of_combo_model(builder.get_object('edit_death_enemy_combo'), 0, death.enemy.id)
|
||||||
builder.get_object('edit_death_enemy_combo').set_active(index)
|
builder.get_object('edit_death_enemy_combo').set_active(index)
|
||||||
|
|
||||||
# TODO Default drink should be set in config
|
# TODO Default drink should be set in config
|
||||||
@@ -135,8 +135,8 @@ def show_edit_death_dialog(builder: Gtk.Builder, episode_id: int, death: sql.Dea
|
|||||||
return result
|
return result
|
||||||
|
|
||||||
# Collect info from widgets and save to database
|
# Collect info from widgets and save to database
|
||||||
player_id = util.Util.get_combo_value(builder.get_object('edit_death_player_combo'), 0)
|
player_id = util.get_combo_value(builder.get_object('edit_death_player_combo'), 0)
|
||||||
enemy_id = util.Util.get_combo_value(builder.get_object('edit_death_enemy_combo'), 3)
|
enemy_id = util.get_combo_value(builder.get_object('edit_death_enemy_combo'), 3)
|
||||||
comment = builder.get_object('edit_death_comment_entry').get_text()
|
comment = builder.get_object('edit_death_comment_entry').get_text()
|
||||||
if not death:
|
if not death:
|
||||||
death = sql.Death.create(episode=episode_id, player=player_id, enemy=enemy_id, info=comment)
|
death = sql.Death.create(episode=episode_id, player=player_id, enemy=enemy_id, info=comment)
|
||||||
@@ -165,7 +165,7 @@ def show_edit_victory_dialog(builder: Gtk.Builder, episode_id: int, victory: sql
|
|||||||
['edit_victory_enemy_combo', victory.enemy.id]]
|
['edit_victory_enemy_combo', victory.enemy.id]]
|
||||||
for info in infos:
|
for info in infos:
|
||||||
combo = builder.get_object(info[0])
|
combo = builder.get_object(info[0])
|
||||||
index = util.Util.get_index_of_combo_model(combo, 0, info[1])
|
index = util.get_index_of_combo_model(combo, 0, info[1])
|
||||||
combo.set_active(index)
|
combo.set_active(index)
|
||||||
builder.get_object('victory_comment_entry').set_text(victory.info)
|
builder.get_object('victory_comment_entry').set_text(victory.info)
|
||||||
|
|
||||||
@@ -177,12 +177,15 @@ def show_edit_victory_dialog(builder: Gtk.Builder, episode_id: int, victory: sql
|
|||||||
return result
|
return result
|
||||||
|
|
||||||
# Collect info from widgets and save to database
|
# Collect info from widgets and save to database
|
||||||
player_id = util.Util.get_combo_value(builder.get_object('edit_victory_player_combo'), 0)
|
player_id = util.get_combo_value(builder.get_object('edit_victory_player_combo'), 0)
|
||||||
enemy_id = util.Util.get_combo_value(builder.get_object('edit_victory_enemy_combo'), 3)
|
enemy_id = util.get_combo_value(builder.get_object('edit_victory_enemy_combo'), 3)
|
||||||
comment = builder.get_object('victory_comment_entry').get_text()
|
comment = builder.get_object('victory_comment_entry').get_text()
|
||||||
if not victory:
|
if not victory:
|
||||||
sql.Victory.create(episode=episode_id, player=player_id, enemy=enemy_id, info=comment)
|
sql.Victory.create(episode=episode_id, player=player_id, enemy=enemy_id, info=comment)
|
||||||
else:
|
else:
|
||||||
victory.update(player=player_id, enemy=enemy_id, info=comment).execute()
|
victory.player = player_id
|
||||||
|
victory.enemy = enemy_id
|
||||||
|
victory.info = comment
|
||||||
|
victory.save()
|
||||||
|
|
||||||
return result
|
return result
|
||||||
@@ -1,6 +1,10 @@
|
|||||||
from collections import Counter
|
from collections import Counter
|
||||||
|
|
||||||
import gi
|
import gi
|
||||||
|
import math
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
gi.require_version('Gtk', '3.0')
|
gi.require_version('Gtk', '3.0')
|
||||||
from gi.repository import Gtk
|
from gi.repository import Gtk
|
||||||
from dsst_gtk3.handlers import handlers
|
from dsst_gtk3.handlers import handlers
|
||||||
@@ -10,7 +14,7 @@ from dsst_sql import sql, sql_func
|
|||||||
|
|
||||||
class GtkUi:
|
class GtkUi:
|
||||||
""" The main UI class """
|
""" The main UI class """
|
||||||
def __init__(self):
|
def __init__(self, config: dict):
|
||||||
# Load Glade UI files
|
# Load Glade UI files
|
||||||
self.ui = Gtk.Builder()
|
self.ui = Gtk.Builder()
|
||||||
glade_resources = [
|
glade_resources = [
|
||||||
@@ -18,15 +22,15 @@ class GtkUi:
|
|||||||
['dsst_gtk3', 'resources', 'glade', 'dialogs.glade']
|
['dsst_gtk3', 'resources', 'glade', 'dialogs.glade']
|
||||||
]
|
]
|
||||||
for path in glade_resources:
|
for path in glade_resources:
|
||||||
self.ui.add_from_string(util.Util.load_ui_resource_string(path))
|
self.ui.add_from_string(util.load_ui_resource_string(path))
|
||||||
# Connect signal handlers to UI
|
# Connect signal handlers to UI
|
||||||
self.handlers = handlers.Handlers(self)
|
self.handlers = handlers.Handlers(self)
|
||||||
self.ui.connect_signals(self.handlers)
|
self.ui.connect_signals(self.handlers)
|
||||||
# Show all widgets
|
# Show all widgets
|
||||||
self.ui.get_object('main_window').show_all()
|
self.ui.get_object('main_window').show_all()
|
||||||
|
db_config = config['sql_connections'][0]
|
||||||
# Initialize the database
|
# Initialize the database
|
||||||
# TODO User input to select database
|
sql.db.init(db_config['db_name'], user=db_config['user'], password=db_config['password'])
|
||||||
sql.db.init('dsst', user='dsst', password='dsst')
|
|
||||||
# Create database if not exists
|
# Create database if not exists
|
||||||
sql_func.create_tables()
|
sql_func.create_tables()
|
||||||
|
|
||||||
@@ -41,7 +45,7 @@ class GtkUi:
|
|||||||
# Rebuild drink store
|
# Rebuild drink store
|
||||||
self.ui.get_object('drink_store').clear()
|
self.ui.get_object('drink_store').clear()
|
||||||
for drink in sql.Drink.select():
|
for drink in sql.Drink.select():
|
||||||
self.ui.get_object('drink_store').append([drink.id, drink.name, str(drink.vol)])
|
self.ui.get_object('drink_store').append([drink.id, drink.name, '{:.2f}%'.format(drink.vol)])
|
||||||
# Rebuild seasons store
|
# Rebuild seasons store
|
||||||
store = self.ui.get_object('seasons_store')
|
store = self.ui.get_object('seasons_store')
|
||||||
store.clear()
|
store.clear()
|
||||||
@@ -115,8 +119,13 @@ class GtkUi:
|
|||||||
self.ui.get_object('ep_death_count_label').set_text(str(len(episode.deaths)))
|
self.ui.get_object('ep_death_count_label').set_text(str(len(episode.deaths)))
|
||||||
drink_count = sum(len(death.penalties) for death in episode.deaths)
|
drink_count = sum(len(death.penalties) for death in episode.deaths)
|
||||||
self.ui.get_object('ep_drinks_label').set_text(str(drink_count))
|
self.ui.get_object('ep_drinks_label').set_text(str(drink_count))
|
||||||
cl_booze = sum(len(death.penalties) * death.penalties[0].size for death in episode.deaths)
|
self.ui.get_object('ep_player_drinks_label').set_text(str(len(episode.deaths)))
|
||||||
self.ui.get_object('ep_booze_label').set_text(str(cl_booze) + "cl")
|
dl_booze = sum(len(death.penalties) * death.penalties[0].size for death in episode.deaths)
|
||||||
|
l_booze = round(dl_booze / 10, 2)
|
||||||
|
self.ui.get_object('ep_booze_label').set_text('{}l'.format(l_booze))
|
||||||
|
dl_booze = sum(len(death.penalties) * death.penalties[0].size for death in episode.deaths)
|
||||||
|
ml_booze = round(dl_booze * 10, 0)
|
||||||
|
self.ui.get_object('ep_player_booze_label').set_text('{}ml'.format(ml_booze))
|
||||||
enemy_list = [death.enemy.name for death in episode.deaths]
|
enemy_list = [death.enemy.name for death in episode.deaths]
|
||||||
sorted_list = Counter(enemy_list).most_common(1)
|
sorted_list = Counter(enemy_list).most_common(1)
|
||||||
if sorted_list:
|
if sorted_list:
|
||||||
@@ -127,7 +136,7 @@ class GtkUi:
|
|||||||
"""Read ID of the selected season from the UI
|
"""Read ID of the selected season from the UI
|
||||||
:return: ID of the selected season
|
:return: ID of the selected season
|
||||||
"""
|
"""
|
||||||
season_id = util.Util.get_combo_value(self.ui.get_object('season_combo_box'), 0)
|
season_id = util.get_combo_value(self.ui.get_object('season_combo_box'), 0)
|
||||||
return season_id if season_id != -1 else None
|
return season_id if season_id != -1 else None
|
||||||
|
|
||||||
def get_selected_episode_id(self):
|
def get_selected_episode_id(self):
|
||||||
@@ -139,5 +148,8 @@ class GtkUi:
|
|||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
GtkUi()
|
if not os.path.isfile(util.CONFIG_PATH):
|
||||||
|
util.save_config(util.DEFAULT_CONFIG, util.CONFIG_PATH)
|
||||||
|
config = util.load_config(util.CONFIG_PATH)
|
||||||
|
GtkUi(config)
|
||||||
Gtk.main()
|
Gtk.main()
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ class BaseDataHandlers:
|
|||||||
self.app = app
|
self.app = app
|
||||||
|
|
||||||
def do_manage_players(self, *_):
|
def do_manage_players(self, *_):
|
||||||
result = dialogs.show_manage_players_dialog(self.app.ui, 'Manage Players')
|
dialogs.show_manage_players_dialog(self.app.ui, 'Manage Players')
|
||||||
|
|
||||||
def do_add_player(self, entry):
|
def do_add_player(self, entry):
|
||||||
if entry.get_text():
|
if entry.get_text():
|
||||||
@@ -17,7 +17,7 @@ class BaseDataHandlers:
|
|||||||
self.app.reload_base_data()
|
self.app.reload_base_data()
|
||||||
|
|
||||||
def do_manage_enemies(self, *_):
|
def do_manage_enemies(self, *_):
|
||||||
result = dialogs.show_manage_enemies_dialog(self.app.ui, self.app.get_selected_season_id())
|
dialogs.show_manage_enemies_dialog(self.app.ui, self.app.get_selected_season_id())
|
||||||
|
|
||||||
def on_player_name_edited(self, _, index, value):
|
def on_player_name_edited(self, _, index, value):
|
||||||
row = self.app.ui.get_object('all_players_store')[index]
|
row = self.app.ui.get_object('all_players_store')[index]
|
||||||
@@ -33,6 +33,12 @@ class BaseDataHandlers:
|
|||||||
.execute()
|
.execute()
|
||||||
self.app.reload_base_data()
|
self.app.reload_base_data()
|
||||||
|
|
||||||
|
def do_add_drink(self, entry):
|
||||||
|
if entry.get_text():
|
||||||
|
sql.Drink.create(name=entry.get_text(), vol=0)
|
||||||
|
entry.set_text('')
|
||||||
|
self.app.reload_base_data()
|
||||||
|
|
||||||
def on_drink_name_edited(self, _, index, value):
|
def on_drink_name_edited(self, _, index, value):
|
||||||
row = self.app.ui.get_object('drink_store')[index]
|
row = self.app.ui.get_object('drink_store')[index]
|
||||||
sql.Drink.update(name=value)\
|
sql.Drink.update(name=value)\
|
||||||
|
|||||||
@@ -16,5 +16,5 @@ class DeathHandlers:
|
|||||||
self.app.reload_for_season()
|
self.app.reload_for_season()
|
||||||
self.app.reload_for_episode()
|
self.app.reload_for_episode()
|
||||||
|
|
||||||
def on_penalty_drink_changed(self, widget, path, text):
|
def on_penalty_drink_changed(self, _, path, text):
|
||||||
self.app.ui.get_object('player_penalties_store')[path][2] = text
|
self.app.ui.get_object('player_penalties_store')[path][2] = text
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ class DialogHandlers:
|
|||||||
""" Signal Handler for Add Player to Episode Button in Manage Episode Dialog
|
""" Signal Handler for Add Player to Episode Button in Manage Episode Dialog
|
||||||
:param combo: Combo box with all the available players
|
:param combo: Combo box with all the available players
|
||||||
"""
|
"""
|
||||||
player_id = util.Util.get_combo_value(combo, 0)
|
player_id = util.get_combo_value(combo, 0)
|
||||||
if player_id:
|
if player_id:
|
||||||
self.app.ui.get_object('add_player_combo_box').set_active(-1)
|
self.app.ui.get_object('add_player_combo_box').set_active(-1)
|
||||||
player = sql.Player.get(sql.Player.id == player_id)
|
player = sql.Player.get(sql.Player.id == player_id)
|
||||||
@@ -28,10 +28,3 @@ class DialogHandlers:
|
|||||||
|
|
||||||
def do_manage_drinks(self, *_):
|
def do_manage_drinks(self, *_):
|
||||||
result = dialogs.show_manage_drinks_dialog(self.app.ui)
|
result = dialogs.show_manage_drinks_dialog(self.app.ui)
|
||||||
|
|
||||||
def do_add_drink(self, entry):
|
|
||||||
if entry.get_text():
|
|
||||||
store = self.app.ui.get_object('drink_store')
|
|
||||||
drink = sql.Drink.create(name=entry.get_text(), vol='0')
|
|
||||||
store.append([drink.id, drink.name, drink.vol])
|
|
||||||
entry.set_text('')
|
|
||||||
|
|||||||
@@ -24,9 +24,9 @@ class Handlers(SeasonHandlers, BaseDataHandlers, DialogHandlers, DeathHandlers,
|
|||||||
VictoryHandlers.__init__(self, app)
|
VictoryHandlers.__init__(self, app)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def do_delete_event(*args):
|
def do_delete_event(*_):
|
||||||
""" Signal will be sent when app should close
|
""" Signal will be sent when app should close
|
||||||
:param args: Arguments to the delete event
|
:param _: Arguments to the delete event
|
||||||
"""
|
"""
|
||||||
Gtk.main_quit()
|
Gtk.main_quit()
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ class SeasonHandlers:
|
|||||||
season_id = self.app.get_selected_season_id()
|
season_id = self.app.get_selected_season_id()
|
||||||
if not season_id:
|
if not season_id:
|
||||||
return
|
return
|
||||||
episode = dialogs.show_episode_dialog(self.app.ui, 'Create new Episode', season_id)
|
dialogs.show_episode_dialog(self.app.ui, 'Create new Episode', season_id)
|
||||||
self.app.reload_for_season()
|
self.app.reload_for_season()
|
||||||
|
|
||||||
def on_selected_episode_changed(self, *_):
|
def on_selected_episode_changed(self, *_):
|
||||||
|
|||||||
@@ -232,150 +232,6 @@
|
|||||||
<column type="gint"/>
|
<column type="gint"/>
|
||||||
</columns>
|
</columns>
|
||||||
</object>
|
</object>
|
||||||
<object class="GtkDialog" id="manage_enemies_dialog">
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="title" translatable="yes">Manage Enemies For This Season</property>
|
|
||||||
<property name="resizable">False</property>
|
|
||||||
<property name="modal">True</property>
|
|
||||||
<property name="default_height">300</property>
|
|
||||||
<property name="type_hint">dialog</property>
|
|
||||||
<property name="deletable">False</property>
|
|
||||||
<child internal-child="vbox">
|
|
||||||
<object class="GtkBox">
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="orientation">vertical</property>
|
|
||||||
<property name="spacing">4</property>
|
|
||||||
<child internal-child="action_area">
|
|
||||||
<object class="GtkButtonBox">
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="layout_style">end</property>
|
|
||||||
<child>
|
|
||||||
<placeholder/>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkButton" id="okButtonRename1">
|
|
||||||
<property name="label">gtk-ok</property>
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="receives_default">True</property>
|
|
||||||
<property name="use_stock">True</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">True</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">False</property>
|
|
||||||
<property name="position">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkBox">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="orientation">vertical</property>
|
|
||||||
<property name="spacing">5</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkBox">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="spacing">5</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkLabel">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="margin_top">5</property>
|
|
||||||
<property name="margin_bottom">5</property>
|
|
||||||
<property name="label" translatable="yes">Add Enemy</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkEntry" id="manage_add_enemy_entry">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<signal name="activate" handler="do_add_enemy" swapped="no"/>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkLabel">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="margin_top">5</property>
|
|
||||||
<property name="margin_bottom">5</property>
|
|
||||||
<property name="label" translatable="yes">All Enemies</property>
|
|
||||||
<property name="xalign">0</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkTreeView" id="manage_enemies_tree_view">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="vexpand">True</property>
|
|
||||||
<property name="model">enemy_season_store</property>
|
|
||||||
<property name="search_column">0</property>
|
|
||||||
<child internal-child="selection">
|
|
||||||
<object class="GtkTreeSelection"/>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkTreeViewColumn">
|
|
||||||
<property name="title" translatable="yes">Name</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkCellRendererText"/>
|
|
||||||
<attributes>
|
|
||||||
<attribute name="text">0</attribute>
|
|
||||||
</attributes>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">2</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">True</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
<action-widgets>
|
|
||||||
<action-widget response="-5">okButtonRename1</action-widget>
|
|
||||||
</action-widgets>
|
|
||||||
<child>
|
|
||||||
<placeholder/>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<object class="GtkAdjustment" id="ep_number_ajustment">
|
<object class="GtkAdjustment" id="ep_number_ajustment">
|
||||||
<property name="upper">1000000</property>
|
<property name="upper">1000000</property>
|
||||||
<property name="step_increment">1</property>
|
<property name="step_increment">1</property>
|
||||||
@@ -901,6 +757,157 @@
|
|||||||
<placeholder/>
|
<placeholder/>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
|
<object class="GtkDialog" id="manage_enemies_dialog">
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="title" translatable="yes">Manage Enemies For This Season</property>
|
||||||
|
<property name="resizable">False</property>
|
||||||
|
<property name="modal">True</property>
|
||||||
|
<property name="default_height">300</property>
|
||||||
|
<property name="type_hint">dialog</property>
|
||||||
|
<property name="deletable">False</property>
|
||||||
|
<child internal-child="vbox">
|
||||||
|
<object class="GtkBox">
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="orientation">vertical</property>
|
||||||
|
<property name="spacing">4</property>
|
||||||
|
<child internal-child="action_area">
|
||||||
|
<object class="GtkButtonBox">
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="layout_style">end</property>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkButton" id="okButtonRename1">
|
||||||
|
<property name="label">gtk-ok</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="receives_default">True</property>
|
||||||
|
<property name="use_stock">True</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">True</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">False</property>
|
||||||
|
<property name="position">0</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="orientation">vertical</property>
|
||||||
|
<property name="spacing">5</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="spacing">5</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="margin_top">5</property>
|
||||||
|
<property name="margin_bottom">5</property>
|
||||||
|
<property name="label" translatable="yes">Add Enemy</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">0</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkEntry" id="manage_add_enemy_entry">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<signal name="activate" handler="do_add_enemy" swapped="no"/>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">0</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="margin_top">5</property>
|
||||||
|
<property name="margin_bottom">5</property>
|
||||||
|
<property name="label" translatable="yes">All Enemies</property>
|
||||||
|
<property name="xalign">0</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkScrolledWindow">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="shadow_type">in</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkTreeView" id="manage_enemies_tree_view">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="vexpand">True</property>
|
||||||
|
<property name="model">enemy_season_store</property>
|
||||||
|
<property name="search_column">0</property>
|
||||||
|
<child internal-child="selection">
|
||||||
|
<object class="GtkTreeSelection"/>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkTreeViewColumn">
|
||||||
|
<property name="title" translatable="yes">Name</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkCellRendererText"/>
|
||||||
|
<attributes>
|
||||||
|
<attribute name="text">0</attribute>
|
||||||
|
</attributes>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">True</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">2</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">True</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<action-widgets>
|
||||||
|
<action-widget response="-5">okButtonRename1</action-widget>
|
||||||
|
</action-widgets>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
<object class="GtkDialog" id="manage_players_dialog">
|
<object class="GtkDialog" id="manage_players_dialog">
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="title" translatable="yes">Manage Players</property>
|
<property name="title" translatable="yes">Manage Players</property>
|
||||||
@@ -1557,7 +1564,7 @@
|
|||||||
<property name="wide_handle">True</property>
|
<property name="wide_handle">True</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkBox">
|
<object class="GtkBox">
|
||||||
<property name="width_request">150</property>
|
<property name="width_request">180</property>
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="orientation">vertical</property>
|
<property name="orientation">vertical</property>
|
||||||
@@ -1814,27 +1821,14 @@
|
|||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel">
|
<object class="GtkLabel" id="ep_death_count_label">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="label" translatable="yes">Total Drinks:</property>
|
<property name="label" translatable="yes">[DeathCount]</property>
|
||||||
<property name="xalign">1</property>
|
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">0</property>
|
<property name="left_attach">1</property>
|
||||||
<property name="top_attach">1</property>
|
<property name="top_attach">0</property>
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkLabel">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="label" translatable="yes">Hardest Enemy:</property>
|
|
||||||
<property name="xalign">1</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">0</property>
|
|
||||||
<property name="top_attach">3</property>
|
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
@@ -1846,6 +1840,61 @@
|
|||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">0</property>
|
<property name="left_attach">0</property>
|
||||||
|
<property name="top_attach">7</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="label" translatable="yes">Hardest Enemy:</property>
|
||||||
|
<property name="xalign">1</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">0</property>
|
||||||
|
<property name="top_attach">8</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel" id="ep_enemy_name_label">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">1</property>
|
||||||
|
<property name="top_attach">7</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel" id="ep_worst_player_label">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">1</property>
|
||||||
|
<property name="top_attach">8</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="label" translatable="yes">Total Drinks:</property>
|
||||||
|
<property name="xalign">1</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">0</property>
|
||||||
|
<property name="top_attach">4</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel" id="ep_drinks_label">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="label" translatable="yes">[DrinkCount]</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">1</property>
|
||||||
<property name="top_attach">4</property>
|
<property name="top_attach">4</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
@@ -1858,29 +1907,7 @@
|
|||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">0</property>
|
<property name="left_attach">0</property>
|
||||||
<property name="top_attach">2</property>
|
<property name="top_attach">5</property>
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkLabel" id="ep_death_count_label">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="label" translatable="yes">[DeathCount]</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">1</property>
|
|
||||||
<property name="top_attach">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkLabel" id="ep_drinks_label">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="label" translatable="yes">[DrinkCount]</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">1</property>
|
|
||||||
<property name="top_attach">1</property>
|
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
@@ -1891,13 +1918,84 @@
|
|||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">1</property>
|
<property name="left_attach">1</property>
|
||||||
|
<property name="top_attach">5</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="label" translatable="yes">Player Drinks:</property>
|
||||||
|
<property name="xalign">1</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">0</property>
|
||||||
|
<property name="top_attach">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="label" translatable="yes">Player Booze:</property>
|
||||||
|
<property name="xalign">1</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">0</property>
|
||||||
<property name="top_attach">2</property>
|
<property name="top_attach">2</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel" id="ep_enemy_name_label">
|
<object class="GtkLabel">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
|
<property name="label" translatable="yes">Player Alc.:</property>
|
||||||
|
<property name="xalign">1</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">0</property>
|
||||||
|
<property name="top_attach">3</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="label" translatable="yes">Total Alc:</property>
|
||||||
|
<property name="xalign">1</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">0</property>
|
||||||
|
<property name="top_attach">6</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel" id="ep_player_drinks_label">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="label" translatable="yes">[PlayerDrinks]</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">1</property>
|
||||||
|
<property name="top_attach">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel" id="ep_player_booze_label">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="label" translatable="yes">[PlayerBooze]</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">1</property>
|
||||||
|
<property name="top_attach">2</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel" id="ep_player_alc_label">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="label" translatable="yes">[PlayerAlc]</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">1</property>
|
<property name="left_attach">1</property>
|
||||||
@@ -1905,13 +2003,14 @@
|
|||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel" id="ep_worst_player_label">
|
<object class="GtkLabel" id="ep_alc_label">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
|
<property name="label" translatable="yes">[TotalAlc]</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">1</property>
|
<property name="left_attach">1</property>
|
||||||
<property name="top_attach">4</property>
|
<property name="top_attach">6</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
@@ -2261,7 +2360,7 @@
|
|||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkTreeViewColumn">
|
<object class="GtkTreeViewColumn">
|
||||||
<property name="title" translatable="yes">Attempts</property>
|
<property name="title" translatable="yes">Deaths</property>
|
||||||
<property name="clickable">True</property>
|
<property name="clickable">True</property>
|
||||||
<property name="sort_indicator">True</property>
|
<property name="sort_indicator">True</property>
|
||||||
<property name="sort_column_id">1</property>
|
<property name="sort_column_id">1</property>
|
||||||
|
|||||||
@@ -1,14 +1,23 @@
|
|||||||
"""
|
"""
|
||||||
This modules contains general utilities for the GTK application to use.
|
This modules contains general utilities for the GTK application to use.
|
||||||
"""
|
"""
|
||||||
|
import json
|
||||||
import os
|
import os
|
||||||
from zipfile import ZipFile
|
from zipfile import ZipFile
|
||||||
|
|
||||||
|
CONFIG_PATH = os.path.join(os.path.expanduser('~'), '.config', 'dsst', 'config.json')
|
||||||
|
DEFAULT_CONFIG = {
|
||||||
|
'auto_connect': False,
|
||||||
|
'sql_connections': [{
|
||||||
|
'host': 'localhost',
|
||||||
|
'db_name': 'dsst',
|
||||||
|
'user': 'dsst',
|
||||||
|
'password': 'dsst'}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
class Util:
|
|
||||||
@staticmethod
|
def get_combo_value(combo, index: int):
|
||||||
def get_combo_value(combo, index: int):
|
|
||||||
""" Retrieve the selected value of a combo box at the selected index in the model
|
""" Retrieve the selected value of a combo box at the selected index in the model
|
||||||
:param combo: Any Gtk Widget that supports 'get_active_iter()'
|
:param combo: Any Gtk Widget that supports 'get_active_iter()'
|
||||||
:param index: Index of the value in the widgets model to be retrieved
|
:param index: Index of the value in the widgets model to be retrieved
|
||||||
@@ -20,8 +29,8 @@ class Util:
|
|||||||
else:
|
else:
|
||||||
return -1
|
return -1
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def get_index_of_combo_model(widget, column: int, value: int):
|
def get_index_of_combo_model(widget, column: int, value: int):
|
||||||
"""Get the index of a value within a Gtk widgets model based on column an value
|
"""Get the index of a value within a Gtk widgets model based on column an value
|
||||||
:param widget: Any Gtk widget that can be bound to a ListStore or TreeStore
|
:param widget: Any Gtk widget that can be bound to a ListStore or TreeStore
|
||||||
:param column: Column in the model where to look for the value
|
:param column: Column in the model where to look for the value
|
||||||
@@ -31,27 +40,40 @@ class Util:
|
|||||||
model = widget.get_model()
|
model = widget.get_model()
|
||||||
return [model.index(entry) for entry in model if entry[column] == value]
|
return [model.index(entry) for entry in model if entry[column] == value]
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def load_ui_resource_string(resource_path: list) -> str:
|
|
||||||
""" Load content of Glade UI files from resources path
|
|
||||||
:param resource_path: List of directory names from 'dsst' base directory
|
|
||||||
:return: String content of the Glade file
|
|
||||||
"""
|
|
||||||
if os.path.isdir(os.path.dirname(__file__)):
|
|
||||||
return Util.load_ui_resource_from_file(resource_path)
|
|
||||||
else:
|
|
||||||
|
|
||||||
return Util.load_ui_resource_from_archive(resource_path)
|
def load_ui_resource_from_file(resource_path: list) -> str:
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def load_ui_resource_from_file(resource_path: list) -> str:
|
|
||||||
project_base_dir = os.path.dirname(os.path.dirname(__file__))
|
project_base_dir = os.path.dirname(os.path.dirname(__file__))
|
||||||
full_path = os.path.join(project_base_dir, *resource_path)
|
full_path = os.path.join(project_base_dir, *resource_path)
|
||||||
with open(full_path, 'r') as file:
|
with open(full_path, 'r') as file:
|
||||||
return file.read()
|
return file.read()
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def load_ui_resource_from_archive(resource_path: list) -> str:
|
def load_ui_resource_from_archive(resource_path: list) -> str:
|
||||||
zip_path = os.path.dirname(os.path.dirname(__file__))
|
zip_path = os.path.dirname(os.path.dirname(__file__))
|
||||||
with ZipFile(zip_path, 'r') as archive:
|
with ZipFile(zip_path, 'r') as archive:
|
||||||
return archive.read(str(os.path.join(*resource_path))).decode('utf-8')
|
return archive.read(str(os.path.join(*resource_path))).decode('utf-8')
|
||||||
|
|
||||||
|
|
||||||
|
def load_ui_resource_string(resource_path: list) -> str:
|
||||||
|
""" Load content of Glade UI files from resources path
|
||||||
|
:param resource_path: List of directory names from 'dsst' base directory
|
||||||
|
:return: String content of the Glade file
|
||||||
|
"""
|
||||||
|
if os.path.isdir(os.path.dirname(__file__)):
|
||||||
|
return load_ui_resource_from_file(resource_path)
|
||||||
|
else:
|
||||||
|
|
||||||
|
return load_ui_resource_from_archive(resource_path)
|
||||||
|
|
||||||
|
|
||||||
|
def load_config(config_path: str) -> dict:
|
||||||
|
with open(config_path) as config_file:
|
||||||
|
return json.load(config_file)
|
||||||
|
|
||||||
|
|
||||||
|
def save_config(config: dict, config_path: str):
|
||||||
|
path = os.path.dirname(config_path)
|
||||||
|
if not os.path.isdir(path):
|
||||||
|
os.mkdir(path)
|
||||||
|
with open(config_path, 'wb') as file:
|
||||||
|
file.write(json.dumps(config, sort_keys=True, indent=4, separators=(',', ': ')).encode('utf-8'))
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ class Drink(Model):
|
|||||||
class Enemy(Model):
|
class Enemy(Model):
|
||||||
id = AutoField()
|
id = AutoField()
|
||||||
name = CharField()
|
name = CharField()
|
||||||
|
optional = BooleanField()
|
||||||
season = ForeignKeyField(Season, backref='enemies')
|
season = ForeignKeyField(Season, backref='enemies')
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
|||||||
Reference in New Issue
Block a user