User.get_orgs

This commit is contained in:
Vincent Jacques
2012-02-12 20:39:40 +01:00
parent 6007a90e09
commit c8dfda6504
4 changed files with 8 additions and 2 deletions
+1
View File
@@ -15,6 +15,7 @@ def dumpUser( u ):
print "<-", r.source.owner.login + "/" + r.source.name,
print
print " Watched:", ", ".join( r.name for r in u.get_watched() )
print " Organizations:", ", ".join( o.login for o in u.get_orgs() )
print
def dumpOrganization( o ):
+2 -2
View File
@@ -424,7 +424,7 @@
/user/orgs
==========
- GET: `` (TODO)
- GET: `AuthenticatedUser.get_orgs()` : list of `Organization`
/user/repos
===========
@@ -471,7 +471,7 @@
/users/:user/orgs
=================
- GET: `` (TODO)
- GET: `NamedUser.get_orgs()` : list of `Organization`
/users/:user/received_events
============================
+2
View File
@@ -9,6 +9,8 @@ class SimpleScalarAttributes:
self.__attributeNames = attributeNames
def getValueFromRawValue( self, obj, rawValue ):
# if isinstance( rawValue, dict ):
# print rawValue, "is a dict, you may want to use an extended attribute for it"
return rawValue
def updateAttributes( self, obj ):
+3
View File
@@ -38,6 +38,9 @@ Organization = GithubObject(
ExtendedListAttribute( "members", NamedUser ),
)
AuthenticatedUser._addAttributePolicy( ExtendedListAttribute( "orgs", Organization ) )
NamedUser._addAttributePolicy( ExtendedListAttribute( "orgs", Organization ) )
Repository = GithubObject(
"Repository",
BaseUrl( lambda obj: "/repos/" + obj.owner.login + "/" + obj.name ),