Skip to content

Commit

Permalink
feat(information_management): Ability to link Knowledge Base article …
Browse files Browse the repository at this point in the history
…to a Device Type

ref: #331 #426 #427 #428
  • Loading branch information
jon-nfc committed Dec 21, 2024
1 parent 81dbc30 commit 4ce8f0f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
10 changes: 10 additions & 0 deletions app/itam/models/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,16 @@ class Meta:
}
]
},
{
"name": "Knowledge Base",
"slug": "kb_articles",
"sections": [
{
"layout": "table",
"field": "knowledge_base",
}
]
},
{
"name": "Notes",
"slug": "notes",
Expand Down
10 changes: 9 additions & 1 deletion app/itam/serializers/device_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,15 @@ class DeviceTypeModelSerializer(
def get_url(self, obj) -> dict:

return {
'_self': obj.get_url( request = self._context['view'].request )
'_self': obj.get_url( request = self._context['view'].request ),
'knowledge_base': reverse(
"v2:_api_v2_model_kb-list",
request=self._context['view'].request,
kwargs={
'model': self.Meta.model._meta.model_name,
'model_pk': item.pk
}
),
}


Expand Down

0 comments on commit 4ce8f0f

Please sign in to comment.