From 2ec13cda763aa06c7a7cd999d48c3afdfa47cd15 Mon Sep 17 00:00:00 2001 From: Mateusz Szwed Date: Tue, 18 Jun 2024 22:46:39 +0200 Subject: [PATCH] code: sortable Songs --- songbook/src/obj/Song.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/songbook/src/obj/Song.py b/songbook/src/obj/Song.py index 8301444..4ae77ca 100644 --- a/songbook/src/obj/Song.py +++ b/songbook/src/obj/Song.py @@ -44,6 +44,9 @@ def expandedSections(self): else: sections.append(section) return sections + + def __lt__(self, other: Song): + return self.title < other.title @property def linkedTitle(self) -> str: