Keys: step 2

This commit is contained in:
Vincent Jacques
2012-03-01 17:56:50 +00:00
parent 3bf073954c
commit df1143107c
2 changed files with 18 additions and 10 deletions
+12 -4
View File
@@ -68,7 +68,7 @@ Keys
----
* `get_keys()`: list of `UserKey`
* `get_key( id )`: `UserKey`
* `create_key()`: `UserKey`
* `create_key( title, key )`: `UserKey`
Followers
---------
@@ -714,7 +714,7 @@ Keys
----
* `get_keys()`: list of `RepositoryKey`
* `get_key( id )`: `RepositoryKey`
* `create_key()`: `RepositoryKey`
* `create_key( title, key )`: `RepositoryKey`
Collaborators
-------------
@@ -817,10 +817,14 @@ Class `RepositoryKey`
Attributes
----------
* `url`
* `id`
* `title`
* `key`
Modification
------------
* `edit()`
* `edit( title, key )`
Deletion
--------
@@ -881,10 +885,14 @@ Class `UserKey`
Attributes
----------
* `url`
* `id`
* `title`
* `key`
Modification
------------
* `edit()`
* `edit( title, key )`
Deletion
--------
+6 -6
View File
@@ -18,9 +18,9 @@ UserKey = GithubObject(
"UserKey",
BaseUrl( lambda obj: "/user/keys/" + str( obj.id ) ),
InternalSimpleAttributes(
### @todo
"url", "id", "title", "key",
),
Editable( [], [] ), ### @todo
Editable( [ "title", "key" ], [] ),
Deletable(),
)
@@ -50,7 +50,7 @@ AuthenticatedUser = GithubObject(
ExternalListOfObjects( "keys", "key", UserKey,
ListGetable( [], [] ),
ElementGetable( [ "id" ], [] ),
ElementCreatable( [], [] ), ### @todo
ElementCreatable( [ "title", "key" ], [] ),
),
)
@@ -373,10 +373,10 @@ RepositoryKey = GithubObject(
"RepositoryKey",
BaseUrl( lambda obj: obj._repo._baseUrl + "/keys/" + str( obj.id ) ),
InternalSimpleAttributes(
### @todo
"url", "id", "title", "key",
"_repo", ### Ugly hack
),
Editable( [], [] ), ### @todo
Editable( [ "title", "key" ], [] ),
Deletable()
)
@@ -412,7 +412,7 @@ Repository._addAttributePolicy( SeveralAttributePolicies( [
ExternalListOfObjects( "keys", "key", RepositoryKey,
ListGetable( [], [] ),
ElementGetable( [ "id" ], [], __modifyAttributesForObjectsReferingRepo ),
ElementCreatable( [], [] ), ### @todo
ElementCreatable( [ "title", "key" ], [] ),
),
ExternalListOfObjects( "collaborators", "collaborator", NamedUser,
ListGetable( [], [] ),