From c278f3e0af76d8142ec5a2fc678cd876068da027 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sat, 17 Oct 2020 17:55:36 -0700 Subject: [PATCH] Let Tag objects be sortable using their name. --- etiquette/objects.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/etiquette/objects.py b/etiquette/objects.py index 38a15b5..91c0bb3 100644 --- a/etiquette/objects.py +++ b/etiquette/objects.py @@ -1246,6 +1246,9 @@ class Tag(ObjectBase, GroupableMixin): self.group_getter_many = self.photodb.get_tags_by_id + def __lt__(self, other): + return self.name < other.name + def __repr__(self): return f'Tag:{self.id}:{self.name}'