Пример #1
0
Файл: api.py Проект: rowhit/h
def read_jsonld(context, request):
    request.response.content_type = 'application/ld+json'
    request.response.content_type_params = {
        'profile': AnnotationJSONLDPresenter.CONTEXT_URL
    }
    presenter = AnnotationJSONLDPresenter(context)
    return presenter.asdict()
Пример #2
0
def read_jsonld(context, request):
    request.response.content_type = "application/ld+json"
    request.response.content_type_params = {
        "charset": "UTF-8",
        "profile": str(AnnotationJSONLDPresenter.CONTEXT_URL),
    }
    presenter = AnnotationJSONLDPresenter(context)
    return presenter.asdict()
Пример #3
0
def read_jsonld(context, request):
    request.response.content_type = "application/ld+json"
    request.response.content_type_params = {
        "charset": "UTF-8",
        "profile": str(AnnotationJSONLDPresenter.CONTEXT_URL),
    }
    presenter = AnnotationJSONLDPresenter(context)
    return presenter.asdict()
Пример #4
0
def read_jsonld(context, request):
    request.response.content_type = "application/ld+json"
    request.response.content_type_params = {
        "charset": "UTF-8",
        "profile": str(AnnotationJSONLDPresenter.CONTEXT_URL),
    }

    return AnnotationJSONLDPresenter(
        context.annotation, links_service=request.find_service(name="links")
    ).asdict()
Пример #5
0
Файл: api.py Проект: gnott/h
def read_jsonld(context, request):
    request.response.content_type = 'application/ld+json'
    request.response.content_type_params = {
        'profile': AnnotationJSONLDPresenter.CONTEXT_URL}
    presenter = AnnotationJSONLDPresenter(context)
    return presenter.asdict()