Skip to content

Commit

Permalink
refactor(api): set fields that are for markdown to use the markdown f…
Browse files Browse the repository at this point in the history
  • Loading branch information
jon-nfc committed Nov 11, 2024
1 parent 53ce9ca commit 6d7863a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/api/serializers/common.py
Original file line number Diff line number Diff line change
@@ -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 )
8 changes: 8 additions & 0 deletions app/assistance/serializers/knowledge_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):

Expand Down Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions app/project_management/serializers/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -75,6 +77,7 @@ def get_url(self, item) -> dict:
),
}

description = centurion_field.MarkdownField( required = False )

class Meta:

Expand Down

0 comments on commit 6d7863a

Please sign in to comment.