def render(self, request): """docstring for render""" def cbLoad(photo): if photo is None or photo.state != Photo.STATE_ACTIVE: return http.Response(responsecode.NOT_FOUND) return PhotoResponse(photo) return Photo.load(self.username, self.filename).addCallback(cbLoad)
def doRender(self, request): """docstring for render""" # TODO check Host & Referer return Photo.load(self.username, self.filename).addCallback(self.onLoad)