Skip to content

Commit

Permalink
Attempting to link to entity; showing ID
Browse files Browse the repository at this point in the history
  • Loading branch information
gythaogg committed Jan 22, 2024
1 parent d6ffa31 commit 87a5c39
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions apis_ontology/tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@
class CustomRelationTableEdit(RelationTable):

id = tables.TemplateColumn("{{ record.id }}")
subject = tables.TemplateColumn("{{ record.subj }}")
object = tables.TemplateColumn("{{ record.obj }}")
subject = tables.TemplateColumn(
"<a href='/entities/entity/{{ record.subj_model }}/{{ record.subj.pk }}'>{{record.subj}} ({{record.subj.pk}})</a>"
)
object = tables.TemplateColumn(
"<a href='/entities/entity/{{ record.obj_model }}/{{ record.obj.pk }}'>{{record.obj}} ({{record.obj.pk}})</a>"
)
description = tables.TemplateColumn("{{ record.name }}")
edit = tables.TemplateColumn(
"<a href='{% url 'apis:relationupdate' record.id %}'>Edit</a>"
Expand Down Expand Up @@ -37,8 +41,12 @@ class Meta:
class CustomRelationTableView(RelationTable):

id = tables.TemplateColumn("{{ record.id }}")
subject = tables.TemplateColumn("{{ record.subj }}")
object = tables.TemplateColumn("{{ record.obj }}")
subject = tables.TemplateColumn(
"<a href='/entities/entity/{{ record.subj_model }}/{{ record.subj.pk }}'>{{record.subj}} ({{record.subj.pk}})</a>"
)
object = tables.TemplateColumn(
"<a href='/entities/entity/{{ record.obj_model }}/{{ record.obj.pk }}'>{{record.obj}} ({{record.obj.pk}})</a>"
)
description = tables.TemplateColumn("{{ record.name }}")
confidence = tables.TemplateColumn("{{ record.confidence }}")
support_notes = tables.TemplateColumn(
Expand Down

0 comments on commit 87a5c39

Please sign in to comment.