Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@
if model_instances:
for model_instance in model_instances:
if name in model_instance._data_store:
values.add(model_instance._data_store[name])
v = model_instance._data_store[name]
if isinstance(v, list):
values.add(tuple(v))
else:
values.add(v)
len_values = len(values)
if len_values == 0:
raise ApiKeyError(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())

def __hash__(self):
"""Returns the hash value of this object."""
return hash(frozenset(self._data_store.items()))

def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, self.__class__):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
"""Returns the string representation of the model"""
return str(self.value)

def __hash__(self):
"""Returns the hash value of this object."""
return hash(self._data_store['value'])

def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, self.__class__):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ def to_str(self):
"""Returns the string representation of the model"""
return str(self.value)

def __hash__(self):
"""Returns the hash value of this object."""
return hash(self._data_store['value'])

def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, self.__class__):
Expand Down Expand Up @@ -204,6 +208,10 @@ def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())

def __hash__(self):
"""Returns the hash value of this object."""
return hash(frozenset(self._data_store.items()))

def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, self.__class__):
Expand Down Expand Up @@ -278,7 +286,11 @@ def __getattr__(self, name):
if model_instances:
for model_instance in model_instances:
if name in model_instance._data_store:
values.add(model_instance._data_store[name])
v = model_instance._data_store[name]
if isinstance(v, list):
values.add(tuple(v))
else:
values.add(v)
len_values = len(values)
if len_values == 0:
raise ApiKeyError(
Expand All @@ -303,6 +315,10 @@ def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())

def __hash__(self):
"""Returns the hash value of this object."""
return hash(frozenset(self._data_store.items()))

def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, self.__class__):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ def to_str(self):
"""Returns the string representation of the model"""
return str(self.value)

def __hash__(self):
"""Returns the hash value of this object."""
return hash(self._data_store['value'])

def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, self.__class__):
Expand Down Expand Up @@ -204,6 +208,10 @@ def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())

def __hash__(self):
"""Returns the hash value of this object."""
return hash(frozenset(self._data_store.items()))

def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, self.__class__):
Expand Down Expand Up @@ -278,7 +286,11 @@ def __getattr__(self, name):
if model_instances:
for model_instance in model_instances:
if name in model_instance._data_store:
values.add(model_instance._data_store[name])
v = model_instance._data_store[name]
if isinstance(v, list):
values.add(tuple(v))
else:
values.add(v)
len_values = len(values)
if len_values == 0:
raise ApiKeyError(
Expand All @@ -303,6 +315,10 @@ def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())

def __hash__(self):
"""Returns the hash value of this object."""
return hash(frozenset(self._data_store.items()))

def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, self.__class__):
Expand Down