This commit is contained in:
Vincent Jacques
2012-02-22 19:42:39 +00:00
parent f2bc0ea942
commit 53d1d97d86
+3 -3
View File
@@ -80,11 +80,11 @@ Repository._addAttributePolicy( ComplexAttribute( "parent", Repository ) )
Repository._addAttributePolicy( ComplexAttribute( "source", Repository ) )
Repository._addAttributePolicy( ListOfReferences( "forks", Repository ) )
__repoCreatable = ElementCreatable( "repo", [ "name" ], [ "description", "homepage", "private", "has_issues", "has_wiki", "has_downloads", "team_id", ] )
__repoElementCreatable = ElementCreatable( "repo", [ "name" ], [ "description", "homepage", "private", "has_issues", "has_wiki", "has_downloads", "team_id", ] )
__repoElementGetable = ElementGetable( "repo", lambda obj, name: { "owner": { "login": obj.login }, "name": name } )
AuthenticatedUser._addAttributePolicy( ListOfObjects( "repos", Repository, ListGetable(), __repoElementGetable, __repoCreatable ) )
AuthenticatedUser._addAttributePolicy( ListOfObjects( "repos", Repository, ListGetable(), __repoElementGetable, __repoElementCreatable ) )
NamedUser._addAttributePolicy( ListOfObjects( "repos", Repository, ListGetable(), __repoElementGetable ) )
Organization._addAttributePolicy( ListOfObjects( "repos", Repository, ListGetable(), __repoElementGetable, __repoCreatable ) )
Organization._addAttributePolicy( ListOfObjects( "repos", Repository, ListGetable(), __repoElementGetable, __repoElementCreatable ) )
AuthenticatedUser._addAttributePolicy( ListOfReferences( "watched", Repository, addable = True, removable = True, hasable = True ) )
NamedUser._addAttributePolicy( ListOfReferences( "watched", Repository ) )