aboutsummaryrefslogtreecommitdiffstats
path: root/github3/models/repos.py
blob: d1b7b7563fc4198f6e9d051ce5ff990254932540 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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)