diff options
author | 2011-11-01 12:30:25 +0100 | |
---|---|---|
committer | 2011-11-01 12:30:25 +0100 | |
commit | b17dbea56f59aa5403e5722e12878c7183742551 (patch) | |
tree | ea02535e78ae2c59d9099850e5ab2d4b1d044f10 /github3/models/repos.py | |
parent | Wip on handlers (diff) | |
download | python-github3-b17dbea56f59aa5403e5722e12878c7183742551.tar.xz python-github3-b17dbea56f59aa5403e5722e12878c7183742551.zip |
Decouple Handlers and Models
Handler User complete
Diffstat (limited to 'github3/models/repos.py')
-rw-r--r-- | github3/models/repos.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/github3/models/repos.py b/github3/models/repos.py new file mode 100644 index 0000000..8dbe970 --- /dev/null +++ b/github3/models/repos.py @@ -0,0 +1,30 @@ +#!/usr/bin/env python +# -*- encoding: utf-8 -*- +# +# author: David Medina + +from .base import BaseResource +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', + } + + @property + def ri(self): + return ('repos', self.owner.login, self.name) + + def __repr__(self): + return '<Repo {0}/{1}>'.format(self.owner.login, self.name) + # owner |