]> git.madduck.net Git - etc/taskwarrior.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Task: Make two Tasks equal by uuid
authorTomas Babej <tomasbabej@gmail.com>
Fri, 26 Dec 2014 15:34:44 +0000 (16:34 +0100)
committerTomas Babej <tomasbabej@gmail.com>
Fri, 26 Dec 2014 15:34:44 +0000 (16:34 +0100)
tasklib/task.py

index bb3fa537438250a7153f3aa214138bbba65819dc..336c050ec12ac56951671332b60ec08fe97f439c 100644 (file)
@@ -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')