X-Git-Url: https://git.madduck.net/etc/taskwarrior.git/blobdiff_plain/c7b2d1ec4f3b96ba04b216b1add37f915d1e5399..351a4268660a1d24d7893b2e3ce8daa8f131f966:/tasklib/task.py?ds=inline diff --git a/tasklib/task.py b/tasklib/task.py index 330491f..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') @@ -284,7 +290,13 @@ class TaskFilter(object): # Replace the value with empty string, since that is the # convention in TW for empty values value = value if value is not None else '' - self.filter_params.append('{0}:{1}'.format(key, value)) + + # If we are filtering by uuid:, do not use uuid keyword + # due to TW-1452 bug + if key == 'uuid': + self.filter_params.insert(0, value) + else: + self.filter_params.append('{0}:{1}'.format(key, value)) def get_filter_params(self): return [f for f in self.filter_params if f]