Use Creatable

This commit is contained in:
Vincent Jacques
2012-02-23 19:16:02 +00:00
parent b822771a56
commit 68e26c62bc
2 changed files with 4 additions and 3 deletions
+3 -2
View File
@@ -203,5 +203,6 @@ IntegrationTest().main()
# To repository
# -------------
# branch = PyGithub.create_git_ref( "refs/heads/test", PyGithub.get_git_ref( "heads/master" ).object[ "sha" ] )
# branch.edit( sha = "9f868e490c79c3ec899dc450e7cb4f9b0fa9e88c", force = True )
# branch = r.create_git_ref( "refs/heads/test", r.get_git_ref( "heads/master" ).object[ "sha" ] )
# branch.edit( "cf96b288a03daba509c0ec7e3e7384fe9e0f472d", force = True )
# r.get_git_ref( "heads/test" ).edit( "9f868e490c79c3ec899dc450e7cb4f9b0fa9e88c", force = True )
+1 -1
View File
@@ -86,7 +86,7 @@ Repository = GithubObject(
ListAttribute( "contributors", NamedUser, ListGetable( [], [] ) ),
ListAttribute( "watchers", NamedUser, ListGetable( [], [] ) ),
Editable( [ "name" ], [ "description", "homepage", "public", "has_issues", "has_wiki", "has_downloads" ] ),
ListOfObjects( "git/refs", GitRef, creatable = True, singularName = "git_ref" ),
ListOfObjects( "git/refs", GitRef, Creatable( "git_ref", [ "ref", "sha" ], [] ) ),
ObjectGetter( "git_ref", GitRef, lambda repo, ref: { "_repo": repo, "ref": ref } ),
)
Repository._addAttributePolicy( ComplexAttribute( "parent", Repository ) )