Esempio n. 1
0
	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)
Esempio n. 2
0
	def doRender(self, request):
		"""docstring for render"""
		# TODO check Host & Referer
		return Photo.load(self.username, self.filename).addCallback(self.onLoad)