Code review comment for lp:~leonardr/lazr.restful/wsgi.improvements.1

Revision history for this message
Leonard Richardson (leonardr) wrote :

This branch does some minor cleanup of lazr.restful to reduce the amount of code in the example web services.

1. I changed some README files to point to the lazr.restful.example.wsgi README, which is the best place to get started learning about lazr.restful. (This was something gary requested while reviewing an earlier branch, that I didn't carry out.)

2. I removed example/wsgi/initialize.py, which wasn't used anywhere.

3. I changed SimplePublication into a mixin, and created a new SimplePublication that included it along with the WebServicePublicationMixin. This removed the need to create new publication classes that included both SimplePublication and WebServicePublicationMixin. I got rid of now-redundant publication classes in lazr.restful.example.wsgi, and slightly simplified the publication class in lazr.restful.testing.webservice.

(Why make SimplePublication a mixin? Why not just make it mix in WebServicePublicationMixin? Because SP.traverseName() expects to be the super() of WSPM. If SP mixes in WSPM, WSPM.traverseName() will be the super() of SP.traverseName(), and the code won't work.)

« Back to merge proposal