diff options
author | 2011-11-09 13:04:48 +0200 | |
---|---|---|
committer | 2011-11-09 13:04:48 +0200 | |
commit | f1a03e9fc8ce87ca1beeae5a92082bb32d342df3 (patch) | |
tree | 6bca689287379b249aff19fbae075182dc22f95a /github3/models/repos.py | |
parent | Added create_gist() example to readme (diff) | |
parent | Fixing bugs. Crazy night :S (diff) | |
download | python-github3-f1a03e9fc8ce87ca1beeae5a92082bb32d342df3.tar.xz python-github3-f1a03e9fc8ce87ca1beeae5a92082bb32d342df3.zip |
Merged create_gist() into current HEAD of copitux/develop
Diffstat (limited to 'github3/models/repos.py')
-rw-r--r-- | github3/models/repos.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/github3/models/repos.py b/github3/models/repos.py new file mode 100644 index 0000000..d1b7b75 --- /dev/null +++ b/github3/models/repos.py @@ -0,0 +1,31 @@ +#!/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): + """ Repo model """ + + @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.__class__, + 'source': self.__class__, + } + } + + def __repr__(self): + return '<Repo %s/%s>' % (self.owner.login, self.name) |