Skip to content

Commit

Permalink
refactor: api_fields positioning
Browse files Browse the repository at this point in the history
  • Loading branch information
asajjad2 committed Feb 27, 2025
1 parent 8216b9c commit 7528944
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions cms/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1344,6 +1344,12 @@ class Meta:
help_text="Price is not changed when a page is saved as draft.",
),
]

api_fields = [
*ProductPage.api_fields,
APIField("program", serializer=ProgramSerializer()),
]

base_form_class = CoursewareForm

program = models.OneToOneField(
Expand All @@ -1353,11 +1359,6 @@ class Meta:
help_text="The program for this page",
)

api_fields = [
APIField("program", serializer=ProgramSerializer()),
*ProductPage.api_fields,
]

@property
def course_pages(self):
"""
Expand Down Expand Up @@ -1493,13 +1494,14 @@ class Meta:
help_text="Price is not changed when a page is saved as draft.",
),
]
base_form_class = CoursewareForm

api_fields = [
APIField("course", serializer=CourseSerializer()),
*ProductPage.api_fields,
APIField("course", serializer=CourseSerializer()),
]

base_form_class = CoursewareForm

@cached_property
def course_with_related_objects(self):
"""
Expand Down

0 comments on commit 7528944

Please sign in to comment.