From 351a4268660a1d24d7893b2e3ce8daa8f131f966 Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Fri, 26 Dec 2014 16:34:44 +0100 Subject: [PATCH] Task: Make two Tasks equal by uuid --- tasklib/task.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tasklib/task.py b/tasklib/task.py index bb3fa53..336c050 100644 --- a/tasklib/task.py +++ b/tasklib/task.py @@ -112,6 +112,12 @@ class Task(TaskResource): def __unicode__(self): return self['description'] + def __eq__(self, other): + return self['uuid'] == other['uuid'] + + def __hash__(self): + return self['uuid'].__hash__() + @property def completed(self): return self['status'] == six.text_type('completed') -- 2.39.5