def get(self, ds_id): devsector = DevelopmentSector.get(ds_id) if devsector: self.response.headers['Content-Type'] = str(devsector.ImageMime) self.response.out.write(devsector.Image) return else: print "failed."
def rename(self): devsector_id = self.request.get('devsector_id', None) new_name = self.request.get('new_name', None) if new_name: devsector = DevelopmentSector.get(devsector_id) devsector.Name = new_name devsector.put() self.context['devsectors'] = DevelopmentSector.query() self.render('/admin/utils/devsectors_list')