Skip to content

Commit

Permalink
feat: remove defined_list/initial_list/frozen_list from the API for now
Browse files Browse the repository at this point in the history
  • Loading branch information
bradenmacdonald committed Feb 15, 2025
1 parent 3545527 commit 275d5d0
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 83 deletions.
50 changes: 0 additions & 50 deletions openedx_learning/apps/authoring/containers/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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:
"""
Expand Down
33 changes: 0 additions & 33 deletions openedx_learning/apps/authoring/units/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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:
"""
Expand Down

0 comments on commit 275d5d0

Please sign in to comment.