[damned-lies] Added Branch.__hash__



commit 2ea36e839a5f4fe77400f0d3c51c360ee1221d39
Author: Claude Paroz <claude 2xlibre net>
Date:   Sat Feb 16 23:53:47 2019 +0100

    Added Branch.__hash__

 stats/models.py | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/stats/models.py b/stats/models.py
index 9aa59710..89819c85 100644
--- a/stats/models.py
+++ b/stats/models.py
@@ -250,6 +250,9 @@ class Branch(models.Model):
         if os.access(str(self.output_dir('ui')), os.W_OK):
             shutil.rmtree(str(self.output_dir('ui')))
 
+    def __hash__(self):
+        return hash(self.pk)
+
     def __eq__(self, other):
         if not isinstance(other, self.__class__):
             return False


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]