aboutsummaryrefslogtreecommitdiffstats
path: root/github3/models/repos.py
diff options
context:
space:
mode:
authorDavid Medina <davidmedina9@gmail.com>2011-11-06 18:14:51 +0100
committerDavid Medina <davidmedina9@gmail.com>2011-11-06 18:14:51 +0100
commit6f2d2115fa578e2d5aa611fe03474341d73f73cc (patch)
tree69cd5dec12ddab57eea69a9f80f7e7d79bde909f /github3/models/repos.py
parentCleaning files from origin repo (diff)
downloadpython-github3-6f2d2115fa578e2d5aa611fe03474341d73f73cc.tar.xz
python-github3-6f2d2115fa578e2d5aa611fe03474341d73f73cc.zip
Modelizer class. json<->model parser
Also reorganize code
Diffstat (limited to 'github3/models/repos.py')
-rw-r--r--github3/models/repos.py35
1 files changed, 18 insertions, 17 deletions
diff --git a/github3/models/repos.py b/github3/models/repos.py
index 8dbe970..ba6ac33 100644
--- a/github3/models/repos.py
+++ b/github3/models/repos.py
@@ -8,23 +8,24 @@ from .user import User
from .orgs import Org
class Repo(BaseResource):
- _strs = [
- 'url', 'html_url', 'clone_url', 'git_url', 'ssh_url', 'svn_url',
- 'name', 'description', 'homepage', 'language', 'master_branch']
- _bools = ['private', 'fork', 'has_issues', 'has_wiki', 'has_downloads']
- _ints = ['forks', 'watchers', 'size', 'open_issues']
- _dates = ['pushed_at', 'created_at']
- _map = {
- 'owner': User,
- 'organization': Org,
- 'parent': 'self',
- 'source': 'self',
- }
+ """ Repo model """
- @property
- def ri(self):
- return ('repos', self.owner.login, self.name)
+ @classmethod
+ def idl(self):
+ return {
+ 'strs': [
+ 'url', 'html_url', 'clone_url', 'git_url', 'ssh_url', 'svn_url',
+ 'name', 'description', 'homepage', 'language', 'master_branch'],
+ 'ints': ['forks', 'watchers', 'size', 'open_issues'],
+ 'dates': ['created_at', 'pushed_at'],
+ 'bools': ['private', 'fork', 'has_issues', 'has_wiki', 'has_downloads'],
+ 'maps': {
+ 'owner': User,
+ 'organization': Org,
+ 'parent': 'self',
+ 'source': 'self',
+ }
+ }
def __repr__(self):
- return '<Repo {0}/{1}>'.format(self.owner.login, self.name)
- # owner
+ return '<Repo %s/%s>' % (self.owner.login, self.name)