diff --git a/app/api/serializers/common.py b/app/api/serializers/common.py index 313072a9c..3033eeb23 100644 --- a/app/api/serializers/common.py +++ b/app/api/serializers/common.py @@ -1,9 +1,16 @@ + from rest_framework import serializers from core import fields as centurion_field +class CommonBaseSerializer(serializers.ModelSerializer): + + pass + + + class CommonModelSerializer(CommonBaseSerializer): model_notes = centurion_field.MarkdownField( required = False ) \ No newline at end of file diff --git a/app/assistance/serializers/knowledge_base.py b/app/assistance/serializers/knowledge_base.py index e68394b90..3fb918f1f 100644 --- a/app/assistance/serializers/knowledge_base.py +++ b/app/assistance/serializers/knowledge_base.py @@ -13,6 +13,9 @@ from assistance.models.knowledge_base import KnowledgeBase from assistance.serializers.knowledge_base_category import KnowledgeBaseCategoryBaseSerializer +from core import fields as centurion_field + + class KnowledgeBaseBaseSerializer(serializers.ModelSerializer): @@ -96,6 +99,11 @@ def get_url(self, item) -> dict: } + content = centurion_field.MarkdownField( required = False ) + + summary = centurion_field.MarkdownField( required = False ) + + class Meta: model = KnowledgeBase diff --git a/app/core/serializers/ticket.py b/app/core/serializers/ticket.py index 5174c27cf..4eb034213 100644 --- a/app/core/serializers/ticket.py +++ b/app/core/serializers/ticket.py @@ -9,6 +9,7 @@ from api.exceptions import UnknownTicketType from core import exceptions as centurion_exception +from core import fields as centurion_field from core.models.ticket.ticket import Ticket from core.fields.badge import Badge, BadgeField @@ -136,6 +137,8 @@ def get_url(self, item) -> dict: return url_dict + description = centurion_field.MarkdownField( required = False ) + duration = serializers.IntegerField(source='duration_ticket', read_only=True) status_badge = BadgeField(label='Status') diff --git a/app/core/serializers/ticket_comment.py b/app/core/serializers/ticket_comment.py index 4c31902e5..3a5cba042 100644 --- a/app/core/serializers/ticket_comment.py +++ b/app/core/serializers/ticket_comment.py @@ -11,6 +11,7 @@ from app.serializers.user import UserBaseSerializer from core import exceptions as centurion_exceptions +from core import fields as centurion_field from core.models.ticket.ticket_comment import Ticket, TicketComment @@ -105,6 +106,9 @@ def get_url(self, item) -> dict: return urls + body = centurion_field.MarkdownField( required = False ) + + class Meta: model = TicketComment diff --git a/app/project_management/serializers/project.py b/app/project_management/serializers/project.py index 16cf885a1..24a34b6ef 100644 --- a/app/project_management/serializers/project.py +++ b/app/project_management/serializers/project.py @@ -10,6 +10,8 @@ from access.serializers.teams import TeamBaseSerializer +from core import fields as centurion_field + from project_management.models.projects import Project from project_management.serializers.project_states import ProjectStateBaseSerializer from project_management.serializers.project_type import ProjectTypeBaseSerializer @@ -75,6 +77,7 @@ def get_url(self, item) -> dict: ), } + description = centurion_field.MarkdownField( required = False ) class Meta: