def __html__(self): request = self.request context = request.context d = url_values_from_document(context) d["annotation"] = context referrers = self.Store(request).search(references=context["id"]) d["annotation"]["referrers"] = referrers if context.get("references", []): parent = context.__parent__[context["references"][-1]] d["quoteSource"] = "annotation" d["quoteUser"] = parent["user"] d["quote"] = parent["text"] else: d["quoteSource"] = "document" d["quote"] = context.quote context["references"] = [] if not "deleted" in context: context["deleted"] = False context["date"] = context["updated"] return {"annotation": json.dumps(d)}
def __html__(self): request = self.request context = request.context if len(context) == 0: raise httpexceptions.HTTPNotFound( body_template= "Either no annotation exists with this identifier, or you " "don't have the permissions required for viewing it." ) d = url_values_from_document(context) d['annotation'] = context d['annotation']['referrers'] = context.referrers if context.get('references', []): parent = context.__parent__[context['references'][-1]] d['quoteSource'] = 'annotation' d['quoteUser'] = parent['user'] d['quote'] = parent['text'] else: d['quoteSource'] = 'document' d['quote'] = context.quote context['references'] = [] if not 'deleted' in context: context['deleted'] = False context['date'] = context['updated'] return {'annotation': json.dumps(d)}
def __html__(self): request = self.request context = request.context if len(context) == 0: raise httpexceptions.HTTPNotFound( body_template= "Either no annotation exists with this identifier, or you " "don't have the permissions required for viewing it.") d = url_values_from_document(context) d['annotation'] = context d['annotation']['referrers'] = context.referrers if context.get('references', []): parent = context.__parent__[context['references'][-1]] d['quote'] = parent['text'] else: d['quote'] = context.quote context['references'] = [] if not 'deleted' in context: context['deleted'] = False context['date'] = context['updated'] return {'annotation': json.dumps(d)}
def __html__(self): request = self.request context = request.context d = url_values_from_document(context) d['annotation'] = context referrers = self.Store(request).search(references=context['id']) d['annotation']['referrers'] = referrers if context.get('references', []): parent = context.__parent__[context['references'][-1]] d['quoteSource'] = 'annotation' d['quoteUser'] = parent['user'] d['quote'] = parent['text'] else: d['quoteSource'] = 'document' d['quote'] = context.quote context['references'] = [] if not 'deleted' in context: context['deleted'] = False context['date'] = context['updated'] return {'annotation': json.dumps(d)}