Skip to content

Commit

Permalink
feat(assistance): add category and org to model articles tab
Browse files Browse the repository at this point in the history
ref: #465 #467
  • Loading branch information
jon-nfc committed Jan 9, 2025
1 parent 56fec0f commit 39307e7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/assistance/models/model_knowledge_base_article.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,10 @@ class Meta:

table_fields: list = [
'article',
'category',
'organization',
'created',
'modified',
]


Expand Down
5 changes: 5 additions & 0 deletions app/assistance/serializers/model_knowledge_base_article.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

from assistance.models.model_knowledge_base_article import all_models, ModelKnowledgeBaseArticle
from assistance.serializers.knowledge_base import KnowledgeBaseBaseSerializer
from assistance.serializers.knowledge_base_category import KnowledgeBaseCategoryBaseSerializer

from core import exceptions as centurion_exceptions

Expand Down Expand Up @@ -54,6 +55,7 @@ class ModelKnowledgeBaseArticleModelSerializer(
):


category = serializers.PrimaryKeyRelatedField(source = 'article.category', read_only = True)

class Meta:

Expand All @@ -63,6 +65,7 @@ class Meta:
'id',
'organization',
'article',
'category',
'created',
'modified',
]
Expand Down Expand Up @@ -137,4 +140,6 @@ class ModelKnowledgeBaseArticleViewSerializer(ModelKnowledgeBaseArticleModelSeri

article = KnowledgeBaseBaseSerializer( read_only = True )

category = KnowledgeBaseCategoryBaseSerializer(source = 'article.category', read_only = True )

organization = OrganizationBaseSerializer( many=False, read_only=True )

0 comments on commit 39307e7

Please sign in to comment.