def get(self): url=self.request.get('ref') try: refs = getentities.get_entity_references(url) except getentities.DownloadError, e: refs = {'error': 'Download Error: %s. Try reloading' % str(e)} self.response.set_status(400)
def get(self): ref = self.request.get('ref', '') context = dict(ref=ref, name=self.request.get('name', None)) try: refs = getentities.get_entity_references(ref) except getentities.DownloadError, e: context['error'] = "Couldn't download external resource: %s" % str(e) refs = []
def get(self): url=self.request.get('ref') refs = getentities.get_entity_references(url) self.response.headers['Content-Type'] = 'application/json' self.response.out.write(json.dumps(refs))
def get(self): ref = self.request.get('ref', '') context = dict(ref=ref, name=self.request.get('name', None), refs=getentities.get_entity_references(ref)) self.render("ref.html", context)