Sort of a feature: Show mastered is now sorted: composer and collection
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import sqlite3
|
||||
from functools import total_ordering
|
||||
|
||||
class Session:
|
||||
|
||||
@@ -117,7 +118,7 @@ class Session:
|
||||
for item in list_of_work_ids:
|
||||
list_of_works.append(work_under_id(item[0], self.db_agent))
|
||||
fun_resultstring = 'All mastered movements:\n'
|
||||
for work in list_of_works:
|
||||
for work in sorted(list_of_works):
|
||||
for mov_number in work.values['movements'].keys():
|
||||
# check if movement is mastered
|
||||
sql_command = f'''
|
||||
@@ -208,6 +209,7 @@ class Session:
|
||||
|
||||
# End session
|
||||
|
||||
@total_ordering
|
||||
class work_under_id:
|
||||
# con = sqlite3.connect('repertoire.db')
|
||||
# reader = con.cursor()
|
||||
@@ -314,6 +316,10 @@ class work_under_id:
|
||||
ret_str += f'{key}: {value}\n'
|
||||
return ret_str
|
||||
|
||||
def __lt__(self, other):
|
||||
return ((self.values['name'], self.sammlung()) <
|
||||
(other.values['name'], self.sammlung()))
|
||||
|
||||
# End work_under_id
|
||||
|
||||
def parse_user_input(user_in, session):
|
||||
|
||||
Reference in New Issue
Block a user