Skip to content

Commit

Permalink
0.9.2
Browse files Browse the repository at this point in the history
  • Loading branch information
SenadI committed Aug 30, 2017
1 parent 191ed72 commit 08c4144
Show file tree
Hide file tree
Showing 18 changed files with 70 additions and 18 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
0.9.2 (2017-08-30)
==================
- Fix `__eq__` method for main resources.

0.9.1 (2017-08-23)
==================
- Fix small bug for interruptible instances.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.9.1
0.9.2
2 changes: 1 addition & 1 deletion sevenbridges/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"""
import logging

__version__ = "0.9.1"
__version__ = "0.9.2"

from sevenbridges.api import Api
from sevenbridges.config import Config
Expand Down
5 changes: 4 additions & 1 deletion sevenbridges/models/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ def id(self):
return self._id

def __eq__(self, other):
return self.id == other.id and self.__class__ == other.__class__
if self is other:
return True
else:
return self.id == other.id and self.__class__ == other.__class__

def __str__(self):
return six.text_type('<App: id={id} rev={rev}>'.format(
Expand Down
5 changes: 4 additions & 1 deletion sevenbridges/models/billing_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ def __str__(self):
return six.text_type('<BillingGroup: id={id}>'.format(id=self.id))

def __eq__(self, other):
return self.id == other.id and self.__class__ == other.__class__
if self is other:
return True
else:
return self.id == other.id and self.__class__ == other.__class__

@classmethod
def query(cls, offset=None, limit=None, api=None):
Expand Down
5 changes: 4 additions & 1 deletion sevenbridges/models/division.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ def __str__(self):
return six.text_type('<Division: id={id}>'.format(id=self.id))

def __eq__(self, other):
return self.id == other.id and self.__class__ == other.__class__
if self is other:
return True
else:
return self.id == other.id and self.__class__ == other.__class__

@classmethod
def query(cls, offset=None, limit=None, api=None):
Expand Down
5 changes: 4 additions & 1 deletion sevenbridges/models/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ def __str__(self):
return six.text_type('<File: id={id}>'.format(id=self.id))

def __eq__(self, other):
return self.id == other.id and self.__class__ == other.__class__
if self is other:
return True
else:
return self.id == other.id and self.__class__ == other.__class__

@classmethod
def query(cls, project, names=None, metadata=None, origin=None, tags=None,
Expand Down
5 changes: 4 additions & 1 deletion sevenbridges/models/invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ def __str__(self):
return six.text_type('<Invoice: id={id}>'.format(id=self.id))

def __eq__(self, other):
return self.id == other.id and self.__class__ == other.__class__
if self is other:
return True
else:
return self.id == other.id and self.__class__ == other.__class__

@classmethod
def query(cls, offset=None, limit=None, api=None):
Expand Down
5 changes: 4 additions & 1 deletion sevenbridges/models/marker.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ def __str__(self):
return six.text_type('<Marker: id={id}>'.format(id=self.id))

def __eq__(self, other):
return self.id == other.id and self.__class__ == other.__class__
if self is other:
return True
else:
return self.id == other.id and self.__class__ == other.__class__

@classmethod
def query(cls, file, offset=None, limit=None, api=None):
Expand Down
5 changes: 4 additions & 1 deletion sevenbridges/models/member.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ def __str__(self):
.format(id=self.id))

def __eq__(self, other):
return self.id == other.id and self.__class__ == other.__class__
if self is other:
return True
else:
return self.id == other.id and self.__class__ == other.__class__

@inplace_reload
def save(self, inplace=True):
Expand Down
5 changes: 4 additions & 1 deletion sevenbridges/models/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ def __str__(self):
return six.text_type('<Project: id={id}>'.format(id=self.id))

def __eq__(self, other):
return self.id == other.id and self.__class__ == other.__class__
if self is other:
return True
else:
return self.id == other.id and self.__class__ == other.__class__

@classmethod
def query(cls, owner=None, offset=None, limit=None, api=None):
Expand Down
5 changes: 4 additions & 1 deletion sevenbridges/models/storage_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ def __str__(self):
return six.text_type('<Export: id={id}>'.format(id=self.id))

def __eq__(self, other):
return self.id == other.id and self.__class__ == other.__class__
if self is other:
return True
else:
return self.id == other.id and self.__class__ == other.__class__

@property
def source(self):
Expand Down
5 changes: 4 additions & 1 deletion sevenbridges/models/storage_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ def __str__(self):
return six.text_type('<Import: id={id}>'.format(id=self.id))

def __eq__(self, other):
return self.id == other.id and self.__class__ == other.__class__
if self is other:
return True
else:
return self.id == other.id and self.__class__ == other.__class__

@property
def result(self):
Expand Down
5 changes: 4 additions & 1 deletion sevenbridges/models/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ def __str__(self):
return six.text_type('<Task: id={id}>'.format(id=self.id))

def __eq__(self, other):
return self.id == other.id and self.__class__ == other.__class__
if self is other:
return True
else:
return self.id == other.id and self.__class__ == other.__class__

@classmethod
def query(cls, project=None, status=None, batch=None,
Expand Down
5 changes: 4 additions & 1 deletion sevenbridges/models/team.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ def __str__(self):
return six.text_type('<Team: id={id}>'.format(id=self.id))

def __eq__(self, other):
return self.id == other.id and self.__class__ == other.__class__
if self is other:
return True
else:
return self.id == other.id and self.__class__ == other.__class__

@classmethod
def query(cls, division, offset=None, limit=None, api=None):
Expand Down
9 changes: 6 additions & 3 deletions sevenbridges/models/team_member.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@ class TeamMember(Resource):
username = StringField(read_only=False)
role = StringField(read_only=True)

def __eq__(self, other):
if self is other:
return True
else:
return self.id == other.id and self.__class__ == other.__class__

def __str__(self):
return six.text_type('<Team member: username={username}>'
.format(username=self.username))

def __eq__(self, other):
return self.id == other.id and self.__class__ == other.__class__
5 changes: 4 additions & 1 deletion sevenbridges/models/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ class User(Resource):
city = StringField(read_only=True)

def __eq__(self, other):
return self.username == other.username
if self is other:
return True
else:
return self.username == other.username

def __str__(self):
return six.text_type(
Expand Down
6 changes: 6 additions & 0 deletions sevenbridges/models/volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ class Volume(Resource):
modified_on = DateTimeField(read_only=True)
active = BooleanField(read_only=True)

def __eq__(self, other):
if self is other:
return True
else:
return self.id == other.id and self.__class__ == other.__class__

def __str__(self):
return six.text_type('<Volume: id={id}>'.format(id=self.id))

Expand Down

0 comments on commit 08c4144

Please sign in to comment.