Skip to content

Commit

Permalink
Merge pull request #30 from gregsadetsky/master
Browse files Browse the repository at this point in the history
Few fixes
  • Loading branch information
martyzz1 authored Feb 24, 2017
2 parents c9b5807 + 4b56e9f commit 741eb09
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
13 changes: 13 additions & 0 deletions heroku3/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,19 @@ def __init__(self):
def __repr__(self):
return "<user '{0}'>".format(self.email)

class Organization(BaseResource):
"""Heroku Organization."""

_strs = ['id', 'name']
_pks = ['id', 'name']

def __init__(self):
self.app = None
super(Organization, self).__init__()

def __repr__(self):
return "<organization '{0}'>".format(self.name)


#class Plan(BaseResource):
#"""Heroku Addon."""
Expand Down
2 changes: 1 addition & 1 deletion heroku3/models/addon.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class Addon(BaseResource):
"""Heroku Addon."""

_strs = ['id', 'config', 'name', 'provider_id', 'web_url']
_pks = ['id']
_pks = ['id', 'name']
_map = {'plan': Plan}
_dates = ['created_at', 'updated_at']

Expand Down
4 changes: 2 additions & 2 deletions heroku3/models/app.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import sys
from pprint import pprint # NOQA

from ..models import BaseResource, Stack, User
from ..models import BaseResource, Stack, User, Organization
from ..rendezvous import Rendezvous
from ..structures import DynoListResource
from .addon import Addon
Expand Down Expand Up @@ -29,7 +29,7 @@ class App(BaseResource):
_ints = ['slug_size', 'repo_size']
_bools = ['maintenance']
_dates = ['archived_at', 'created_at', 'released_at', 'updated_at']
_map = {'region': Region, 'owner': User, 'stack': Stack}
_map = {'region': Region, 'owner': User, 'stack': Stack, 'organization': Organization}
_pks = ['name', 'id']

def __init__(self):
Expand Down
3 changes: 3 additions & 0 deletions heroku3/structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ def __init__(self, items=None):
self._obj = None
self._kwargs = {}

def __len__(self):
return len(self._items)

def __repr__(self):
return repr(self._items)

Expand Down

0 comments on commit 741eb09

Please sign in to comment.