app/compare_page.py
def sort_fighters(self):
        """Based on selected option, group and order
        fighters in a certain schedule in GUI database."""

        try:
            # grab selected option from list
            selected_option = self.sort_box_variants_list.get(
                self.sort_box_variants_list.curselection())

            # grab proper db command based on selected option
            selected_db_command_condition = DB_COMMAND_CONDITIONS_DICT[
                selected_option
            ]

            # grab appropriate fighters
            sorted_fighters = DatabaseManager().return_certain_fighter_list(
                condition=selected_db_command_condition
            )

            # add them to gui list
            self.fighters_list.delete(0, END)
            for index, fighter in enumerate(sorted_fighters):
                index += 1
                fighter_name = fighter[0]
                fighter_alias = f" - {fighter[1]}" if fighter[1] else ''
                self.fighters_list.insert(
                    index, f"{index}. {fighter_name}{fighter_alias}")

        except Exception as e:
            print(e)
            messagebox.showerror(
                title="Error!",
                message="Select an option!"
            )
Based on selected option, group and order
        fighters in a certain schedule in GUI database.
Based on selected option, group and order
fighters in a certain schedule in GUI database.
Based on selected option group and order fighters in a certain schedule in GUI database .
def sort_fighters(self):
        try:
            selected_option = self.sort_box_variants_list.get(
                self.sort_box_variants_list.curselection())
            selected_db_command_condition = DB_COMMAND_CONDITIONS_DICT[
                selected_option
            ]
            sorted_fighters = DatabaseManager().return_certain_fighter_list(
                condition=selected_db_command_condition
            )
            self.fighters_list.delete(0, END)
            for index, fighter in enumerate(sorted_fighters):
                index += 1
                fighter_name = fighter[0]
                fighter_alias = f" - {fighter[1]}" if fighter[1] else ''
                self.fighters_list.insert(
                    index, f"{index}. {fighter_name}{fighter_alias}")
        except Exception as e:
            print(e)
            messagebox.showerror(
                title="Error!",
                message="Select an option!"
            )
def sort_fighters ( self ) : try : selected_option = self . sort_box_variants_list . get ( self . sort_box_variants_list . curselection ( ) ) selected_db_command_condition = DB_COMMAND_CONDITIONS_DICT [ selected_option ] sorted_fighters = DatabaseManager ( ) . return_certain_fighter_list ( condition = selected_db_command_condition ) self . fighters_list . delete ( 0 , END ) for index , fighter in enumerate ( sorted_fighters ) : index += 1 fighter_name = fighter [ 0 ] fighter_alias = f" - {fighter[1]}" if fighter [ 1 ] else '' self . fighters_list . insert ( index , f"{index}. {fighter_name}{fighter_alias}" ) except Exception as e : print ( e ) messagebox . showerror ( title = "Error!" , message = "Select an option!" )
Based on selected option, group and order
fighters in a certain schedule in GUI database.
Based on selected option group and order fighters in a certain schedule in GUI database .
"""Based on selected option, group and order
        fighters in a certain schedule in GUI database.""" # grab selected option from list # grab proper db command based on selected option # grab appropriate fighters # add them to gui list
self