Skip to content

Commit

Permalink
Merge pull request #46 from diggyk/master
Browse files Browse the repository at this point in the history
Fixed bad []
  • Loading branch information
jathanism committed Sep 18, 2015
2 parents 6931b85 + 3539158 commit 3b1a2c7
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions hermes/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ def href(self, base_uri):
"""
return "{}/eventtypes/{}".format(base_uri, self.id)

def to_dict(self, base_uri=None, expand=[]):
def to_dict(self, base_uri=None, expand=None):
"""Translate this object into a dict for serialization
Args:
Expand All @@ -320,6 +320,9 @@ def to_dict(self, base_uri=None, expand=[]):
dict representation of this object
"""

if expand is None:
expand = []

if "eventtypes" in expand:
expand.remove("eventtypes")

Expand Down Expand Up @@ -465,7 +468,7 @@ def href(self, base_uri):
"""
return "{}/hosts/{}".format(base_uri, self.hostname)

def to_dict(self, base_uri=None, expand=[]):
def to_dict(self, base_uri=None, expand=None):
"""Translate this object into a dict for serialization
Args:
Expand All @@ -475,6 +478,8 @@ def to_dict(self, base_uri=None, expand=[]):
Returns:
dict representation of this object
"""
if expand is None:
expand = []

if "hosts" in expand:
expand.remove("hosts")
Expand Down Expand Up @@ -811,7 +816,7 @@ def href(self, base_uri):
"""
return "{}/fates/{}".format(base_uri, self.id)

def to_dict(self, base_uri=None, expand=[]):
def to_dict(self, base_uri=None, expand=None):
"""Translate this object into a dict for serialization
Args:
Expand All @@ -821,6 +826,8 @@ def to_dict(self, base_uri=None, expand=[]):
Returns:
dict representation of this object
"""
if expand is None:
expand = []

if "fates" in expand:
expand.remove("fates")
Expand Down Expand Up @@ -979,7 +986,7 @@ def href(self, base_uri):
"""
return "{}/events/{}".format(base_uri, self.id)

def to_dict(self, base_uri=None, expand=[]):
def to_dict(self, base_uri=None, expand=None):
"""Translate this object into a dict for serialization
Args:
Expand All @@ -990,6 +997,9 @@ def to_dict(self, base_uri=None, expand=[]):
dict representation of this object
"""

if expand is None:
expand = []

if "events" in expand:
expand.remove("events")

Expand Down Expand Up @@ -1291,7 +1301,7 @@ def href(self, base_uri):
"""
return "{}/quests/{}".format(base_uri, self.id)

def to_dict(self, base_uri=None, expand=[], only_open_labors=False):
def to_dict(self, base_uri=None, expand=None, only_open_labors=False):
"""Translate this object into a dict for serialization
Args:
Expand All @@ -1303,6 +1313,9 @@ def to_dict(self, base_uri=None, expand=[], only_open_labors=False):
dict representation of this object
"""

if expand is None:
expand = []

if "quests" in expand:
expand.remove("quests")

Expand Down Expand Up @@ -1544,7 +1557,7 @@ def href(self, base_uri):
"""
return "{}/labors/{}".format(base_uri, self.id)

def to_dict(self, base_uri=None, expand=[]):
def to_dict(self, base_uri=None, expand=None):
"""Translate this object into a dict for serialization
Args:
Expand All @@ -1554,6 +1567,9 @@ def to_dict(self, base_uri=None, expand=[]):
Returns:
dict representation of this object
"""
if expand is None:
expand = []

out = {
"id": self.id,
"startingLaborId": self.starting_labor_id,
Expand Down

0 comments on commit 3b1a2c7

Please sign in to comment.