add question schema model and integrate most urls/views
This commit is contained in:
+23
-1
@@ -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)
|
||||
Reference in New Issue
Block a user