Hooks: step 2

This commit is contained in:
Vincent Jacques
2012-03-04 09:46:18 +00:00
parent 0b8ffcc14c
commit f03d86c46e
2 changed files with 23 additions and 4 deletions
+5 -4
View File
@@ -5,12 +5,13 @@ from GithubObject import *
Hook = GithubObject(
"Hook",
BaseUrl( lambda obj: obj._repo._baseUrl + "/hooks/" + obj.id ),
BaseUrl( lambda obj: obj._repo._baseUrl + "/hooks/" + str( obj.id ) ),
InternalSimpleAttributes(
### @todo
"url", "updated_at", "created_at", "name", "events", "active", "config",
"id", "last_response",
"_repo", ### Ugly hack
),
Editable( [], [] ), #### @todo
Editable( [ "name", "config" ], [ "events", "add_events", "remove_events", "active" ] ),
Deletable(),
)
@@ -422,7 +423,7 @@ Repository._addAttributePolicy( SeveralAttributePolicies( [
ExternalListOfObjects( "hooks", "hook", Hook,
ListGetable( [], [], __modifyAttributesForObjectsReferingRepo ),
ElementGetable( [ "id" ], [], __modifyAttributesForObjectsReferingRepo ),
ElementCreatable( [], [], __modifyAttributesForObjectsReferingReferedRepo ), ### @todo
ElementCreatable( [ "name", "config" ], [ "events", "active" ], __modifyAttributesForObjectsReferingRepo ),
),
ExternalListOfObjects( "keys", "key", RepositoryKey,
ListGetable( [], [], __modifyAttributesForObjectsReferingRepo ),