From 275d5d0a7c3608f68ee233dc7374094231c962cc Mon Sep 17 00:00:00 2001 From: Braden MacDonald Date: Fri, 14 Feb 2025 16:46:16 -0800 Subject: [PATCH] feat: remove defined_list/initial_list/frozen_list from the API for now --- .../apps/authoring/containers/api.py | 50 ------------------- openedx_learning/apps/authoring/units/api.py | 33 ------------ 2 files changed, 83 deletions(-) diff --git a/openedx_learning/apps/authoring/containers/api.py b/openedx_learning/apps/authoring/containers/api.py index 246773ce..a186beb7 100644 --- a/openedx_learning/apps/authoring/containers/api.py +++ b/openedx_learning/apps/authoring/containers/api.py @@ -28,9 +28,6 @@ "create_next_container_version", "create_container_and_version", "get_container", - "get_defined_list_rows_for_container_version", - "get_initial_list_rows_for_container_version", - "get_frozen_list_rows_for_container_version", "ContainerEntityListEntry", "get_entities_in_draft_container", "get_entities_in_published_container", @@ -424,53 +421,6 @@ def get_container(pk: int) -> ContainerEntity: return ContainerEntity.objects.get(pk=pk) -def get_defined_list_rows_for_container_version( - container_version: ContainerEntityVersion, -) -> QuerySet[EntityListRow]: - """ - Get the user-defined members of a container version. - - Args: - container_version: The container version to get the members of. - - Returns: - The members of the container version. - """ - return container_version.defined_list.entitylistrow_set.all() - - -def get_initial_list_rows_for_container_version( - container_version: ContainerEntityVersion, -) -> QuerySet[EntityListRow]: - """ - Get the initial members of a container version. - - Args: - container_version: The container version to get the initial members of. - - Returns: - The initial members of the container version. - """ - return container_version.initial_list.entitylistrow_set.all() - - -def get_frozen_list_rows_for_container_version( - container_version: ContainerEntityVersion, -) -> QuerySet[EntityListRow]: - """ - Get the frozen members of a container version. - - Args: - container_version: The container version to get the frozen members of. - - Returns: - The frozen members of the container version. - """ - if container_version.frozen_list is None: - return QuerySet[EntityListRow]() - return container_version.frozen_list.entitylistrow_set.all() - - @dataclass(frozen=True) class ContainerEntityListEntry: """ diff --git a/openedx_learning/apps/authoring/units/api.py b/openedx_learning/apps/authoring/units/api.py index 597cc5d1..e4073ac9 100644 --- a/openedx_learning/apps/authoring/units/api.py +++ b/openedx_learning/apps/authoring/units/api.py @@ -24,9 +24,6 @@ "get_unit", "get_unit_version", "get_latest_unit_version", - "get_user_defined_list_in_unit_version", - "get_initial_list_in_unit_version", - "get_frozen_list_in_unit_version", "UnitListEntry", "get_components_in_draft_unit", "get_components_in_published_unit", @@ -197,36 +194,6 @@ def get_latest_unit_version(unit_pk: int) -> UnitVersion: return Unit.objects.get(pk=unit_pk).versioning.latest -def get_user_defined_list_in_unit_version(unit_version_pk: int) -> QuerySet[EntityListRow]: - """Get the list in a unit version. - - Args: - unit_version_pk: The unit version ID. - """ - unit_version = UnitVersion.objects.get(pk=unit_version_pk) - return container_api.get_defined_list_rows_for_container_version(unit_version.container_entity_version) - - -def get_initial_list_in_unit_version(unit_version_pk: int) -> list[int]: - """Get the initial list in a unit version. - - Args: - unit_version_pk: The unit version ID. - """ - unit_version = UnitVersion.objects.get(pk=unit_version_pk) - return container_api.get_initial_list_rows_for_container_version(unit_version.container_entity_version) - - -def get_frozen_list_in_unit_version(unit_version_pk: int) -> list[int]: - """Get the frozen list in a unit version. - - Args: - unit_version_pk: The unit version ID. - """ - unit_version = UnitVersion.objects.get(pk=unit_version_pk) - return container_api.get_frozen_list_rows_for_container_version(unit_version.container_entity_version) - - @dataclass(frozen=True) class UnitListEntry: """