add question schema model and integrate most urls/views

This commit is contained in:
Ross
2024-06-24 11:43:33 +01:00
parent 71fefe6c4f
commit cef06e4682
12 changed files with 232 additions and 25 deletions
+23 -1
View File
@@ -9,6 +9,7 @@ from .models import (
Condition,
PathologicalProcess,
Presentation,
QuestionSchema,
Series,
Structure,
Finding,
@@ -337,4 +338,25 @@ class CaseCollectionTable(tables.Table):
),
*args,
**kwargs,
)
)
class QuestionSchemaTable(tables.Table):
name = tables.Column(
linkify=("atlas:question_schema_detail", {"pk": tables.A("pk")}),
verbose_name="QuestionSchema",
)
edit = tables.LinkColumn(
"atlas:question_schema_update", text="Edit", args=[A("pk")], orderable=False
)
delete = tables.LinkColumn(
"atlas:question_schema_delete", text="Delete", args=[A("pk")], orderable=False
)
class Meta:
model = QuestionSchema
template_name = "django_tables2/bootstrap4.html"
fields = ("name", "description", "schema")
def render_schema(self, value, record):
return format_html("<details><summary>Schema</summary>{}</details>", value)