From 06d745e4a425c2e5a143ff492e26f42f22b999d9 Mon Sep 17 00:00:00 2001 From: Daniel Bauer Date: Fri, 22 Nov 2024 11:03:19 +0100 Subject: [PATCH] more documentation on examples --- example/example/views.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/example/example/views.py b/example/example/views.py index 3090335..30285a4 100644 --- a/example/example/views.py +++ b/example/example/views.py @@ -8,6 +8,8 @@ from django_signposting.utils import add_signposts, jsonld_to_signposts class SimpleView(View): + """ A simple view that adds signposting headers to the response.""" + def get(self, request): response = HttpResponse("Hello, world!") @@ -22,6 +24,9 @@ class SimpleView(View): class JsonLdView(JsonLdContextMixin, View): + """ A view that automatically adds signposting headers to the response based on + the JSON-LD metadata in the response.""" + sd = { "@context": "https://schema.org", "@type": ["WebSite", "Dataset"], @@ -68,6 +73,8 @@ class JsonLdView(JsonLdContextMixin, View): class rocrate(JsonLdContextMixin, View): + """ A view that adds signposting headers from the metadata of a detached RO-Crate.""" + def get(self, request): import json import os