Skip to content

Commit

Permalink
Model Save method returns a Thingy object
Browse files Browse the repository at this point in the history
  • Loading branch information
mevinbabuc committed Mar 14, 2018
1 parent d9869af commit 4fa343f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions appnexus/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def save(self, **kwargs):
result = self.create(payload, **kwargs)
else:
result = self.modify(payload, id=self.id, **kwargs)
return result
return type(self)(result)


class Campaign(Model):
Expand All @@ -86,9 +86,8 @@ def profile(self):

class Report(Model):

@classmethod
def download(cls, **kwargs):
return cls.client.get("report-download", **kwargs)
def download(self, **kwargs):
return self.client.get("report-download", id=self.report_id)


def create_models(services_list):
Expand Down

0 comments on commit 4fa343f

Please sign in to comment.