Code review comment for lp:~leonardr/lazr.restful/double-your-enjoyment

Revision history for this message
Edwin Grubbs (edwin-grubbs) wrote :

Hi Leonard,

This branch looks good. I have some very minor comments below.

merge-approved

-Edwin

>=== added file 'src/lazr/restful/docs/multiversion.txt'
>+ >>> from lazr.restful.simple import TraverseWithGet
>+ >>> from zope.publisher.interfaces.browser import IBrowserRequest
>+ >>> class ContactSet(TraverseWithGet):
>+ ... implements(IContactSet)
>+ ... path = "contact"

Please fix the path variable as discussed on IRC.

>+ ...
>+ ... def __init__(self):
>+ ... self.contacts = CONTACTS
>+ ...
>+ ... def get(self, name):
>+ ... contacts = [contact for contacts in self.contacts
>+ ... if pair.name == name]
>+ ... if len(contacts) == 1:
>+ ... return contacts[0]
>+ ... return None
>+ >>> sm.registerAdapter(TraverseWithGet, [ITestDataObject, IBrowserRequest])

Line too long.

>=== modified file 'src/lazr/restful/docs/webservice.txt'
>@@ -417,16 +406,15 @@
> ... def getAllAuthors(self):
> ... return self.authors
> ...
>- ... def get(self, name):
>+ ... def get(self, request, name):
> ... match = [p for p in self.authors if p.name == name]
> ... if len(match) > 0:
> ... return match[0]
> ... return None
>
>+ >>> sm.registerAdapter(TraverseWithGet, [ITestDataObject, IBrowserRequest])

Line too long.

review: Approve (code)

« Back to merge proposal