AuthenticatedUser.get_organization_events

This commit is contained in:
Vincent Jacques
2012-03-12 21:48:27 +01:00
parent 236fcaead6
commit b12b6ffdfa
4 changed files with 21 additions and 1 deletions
+10
View File
@@ -191,6 +191,16 @@ NamedUser._addAttributePolicy(
)
)
def __getOrganizationEvents( user, org ):
return [
Event( user._github, attributes, lazy = True )
for attributes
in user._github._dataRequest( "GET", "/users/" + user.login + "/events/orgs/" + org.login, None, None )
]
AuthenticatedUser._addAttributePolicy(
MethodFromCallable( "get_organization_events", [ "org" ], [], __getOrganizationEvents, SimpleTypePolicy( "list of `Event`" ) )
)
GitRef = GithubObject(
"GitRef",
BaseUrl( lambda obj: obj._repo._baseUrl + "/git/" + obj.ref ),