aboutsummaryrefslogtreecommitdiffstats
path: root/github3/models/orgs.py
diff options
context:
space:
mode:
authorDavid Medina <davidmedina9@gmail.com>2011-11-01 12:30:25 +0100
committerDavid Medina <davidmedina9@gmail.com>2011-11-01 12:30:25 +0100
commitb17dbea56f59aa5403e5722e12878c7183742551 (patch)
treeea02535e78ae2c59d9099850e5ab2d4b1d044f10 /github3/models/orgs.py
parentWip on handlers (diff)
downloadpython-github3-b17dbea56f59aa5403e5722e12878c7183742551.tar.xz
python-github3-b17dbea56f59aa5403e5722e12878c7183742551.zip
Decouple Handlers and Models
Handler User complete
Diffstat (limited to 'github3/models/orgs.py')
-rw-r--r--github3/models/orgs.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/github3/models/orgs.py b/github3/models/orgs.py
new file mode 100644
index 0000000..1ce638e
--- /dev/null
+++ b/github3/models/orgs.py
@@ -0,0 +1,28 @@
+#!/usr/bin/env python
+# -*- encoding: utf-8 -*-
+#
+# author: David Medina
+
+from .base import BaseResource
+from .user import Plan
+
+class Org(BaseResource):
+ """Github Organization object model."""
+
+ _strs = [
+ 'login', 'url', 'avatar_url', 'name', 'company', 'blog', 'location', 'email'
+ 'html_url', 'type', 'billing_email']
+ _ints = [
+ 'id', 'public_repos', 'public_gists', 'followers', 'following',
+ 'total_private_repos', 'owned_private_repos', 'private_gists', 'disk_usage',
+ 'collaborators']
+ _dates = ['created_at']
+ _map = {'plan': Plan}
+ _writable = ['billing_email', 'blog', 'company', 'email', 'location', 'name']
+
+ @property
+ def ri(self):
+ return ('orgs', self.login)
+
+ def __repr__(self):
+ return '<org {0}>'.format(self.login)