Mentions légales du service

Skip to content
Snippets Groups Projects
Verified Commit c7088d60 authored by SIMONIN Matthieu's avatar SIMONIN Matthieu
Browse files

Object equality through id

parent fa927aaf
No related branches found
No related tags found
No related merge requests found
# 0.3.0
- Two object are equals if they share the same id (`get_id`)
# 0.2.3
- Allow for a default ssl user in the client
......
......@@ -158,3 +158,10 @@ class RESTObject(object):
d.update(self.__dict__["_attrs"])
d.update(self.__dict__["_parent_attrs"])
return d
# equality via get_id
def __hash__(self):
return self.get_id().__hash__()
def __eq__(self, value):
return self.get_id() == value.get_id()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment