openedx-learning 0.25.0__py2.py3-none-any.whl → 0.26.0__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,4 +2,4 @@
2
2
  Open edX Learning ("Learning Core").
3
3
  """
4
4
 
5
- __version__ = "0.25.0"
5
+ __version__ = "0.26.0"
@@ -1203,6 +1203,7 @@ def get_container_by_key(learning_package_id: int, /, key: str) -> Container:
1203
1203
  def get_containers(
1204
1204
  learning_package_id: int,
1205
1205
  container_cls: type[ContainerModel] = Container, # type: ignore[assignment]
1206
+ include_deleted: bool | None = False,
1206
1207
  ) -> QuerySet[ContainerModel]:
1207
1208
  """
1208
1209
  [ 🛑 UNSTABLE ]
@@ -1211,12 +1212,17 @@ def get_containers(
1211
1212
  Args:
1212
1213
  learning_package_id: The primary key of the learning package
1213
1214
  container_cls: The subclass of Container to use, if applicable
1215
+ include_deleted: If True, include deleted containers (with no draft version) in the result.
1214
1216
 
1215
1217
  Returns:
1216
1218
  A queryset containing the container associated with the given learning package.
1217
1219
  """
1218
1220
  assert issubclass(container_cls, Container)
1219
- return container_cls.objects.filter(publishable_entity__learning_package=learning_package_id)
1221
+ container_qset = container_cls.objects.filter(publishable_entity__learning_package=learning_package_id)
1222
+ if not include_deleted:
1223
+ container_qset = container_qset.filter(publishable_entity__draft__version__isnull=False)
1224
+
1225
+ return container_qset.order_by('pk')
1220
1226
 
1221
1227
 
1222
1228
  def get_collection_containers(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: openedx-learning
3
- Version: 0.25.0
3
+ Version: 0.26.0
4
4
  Summary: Open edX Learning Core and Tagging.
5
5
  Home-page: https://github.com/openedx/openedx-learning
6
6
  Author: David Ormsbee
@@ -19,10 +19,10 @@ Classifier: Programming Language :: Python :: 3.11
19
19
  Classifier: Programming Language :: Python :: 3.12
20
20
  Requires-Python: >=3.11
21
21
  License-File: LICENSE.txt
22
- Requires-Dist: attrs
23
- Requires-Dist: edx-drf-extensions
24
22
  Requires-Dist: djangorestframework<4.0
25
23
  Requires-Dist: celery
24
+ Requires-Dist: edx-drf-extensions
25
+ Requires-Dist: attrs
26
26
  Requires-Dist: Django
27
27
  Requires-Dist: rules<4.0
28
28
  Dynamic: author
@@ -1,4 +1,4 @@
1
- openedx_learning/__init__.py,sha256=lNlJOtMWHuLa4KYYQnRoBVXd6zGNsGJtRfTQzq3XeD8,69
1
+ openedx_learning/__init__.py,sha256=gxlH6AqH1wFwipo5FfaLp8R8Uxg7pp57boi7X8I4LT0,69
2
2
  openedx_learning/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  openedx_learning/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  openedx_learning/api/authoring.py,sha256=1sh-hUH3pJLVIQHzzjlqWb_9uxf9y3-hanLpU4mRvXc,1061
@@ -37,7 +37,7 @@ openedx_learning/apps/authoring/contents/migrations/0001_initial.py,sha256=FtOTm
37
37
  openedx_learning/apps/authoring/contents/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
38
38
  openedx_learning/apps/authoring/publishing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
39
39
  openedx_learning/apps/authoring/publishing/admin.py,sha256=sLmtttaYIQi8XWw_wOdDD9xbF34g1giMEj5yIN-b-4M,7012
40
- openedx_learning/apps/authoring/publishing/api.py,sha256=tGFZGI6cod2ymabjLXn3RqfjzUwb95ioSOm77LD8vcA,55246
40
+ openedx_learning/apps/authoring/publishing/api.py,sha256=BQ5Q0JsSRBmb8ZRKzUlEOOV6QxNUjYkkqCjxmnX9O48,55565
41
41
  openedx_learning/apps/authoring/publishing/apps.py,sha256=v9PTe3YoICaYT9wfu268ZkVAlnZFvxi-DqYdbRi25bY,750
42
42
  openedx_learning/apps/authoring/publishing/contextmanagers.py,sha256=AH5zhr0Tz_gUG9--dfr_oZAu8DMy94n6mnOJuPbWkeU,6723
43
43
  openedx_learning/apps/authoring/publishing/migrations/0001_initial.py,sha256=wvekNV19YRSdxRmQaFnLSn_nCsQlHIucPDVMmgKf_OE,9272
@@ -87,7 +87,7 @@ openedx_learning/lib/fields.py,sha256=eiGoXMPhRuq25EH2qf6BAODshAQE3DBVdIYAMIUAXW
87
87
  openedx_learning/lib/managers.py,sha256=-Q3gxalSqyPZ9Im4DTROW5tF8wVTZLlmfTe62_xmowY,1643
88
88
  openedx_learning/lib/test_utils.py,sha256=g3KLuepIZbaDBCsaj9711YuqyUx7LD4gXDcfNC-mWdc,527
89
89
  openedx_learning/lib/validators.py,sha256=iqEdEAvFV2tC7Ecssx69kjecpdU8nE87AlDJYrqrsnc,404
90
- openedx_learning-0.25.0.dist-info/licenses/LICENSE.txt,sha256=QTW2QN7q3XszgUAXm9Dzgtu5LXYKbR1SGnqMa7ufEuY,35139
90
+ openedx_learning-0.26.0.dist-info/licenses/LICENSE.txt,sha256=QTW2QN7q3XszgUAXm9Dzgtu5LXYKbR1SGnqMa7ufEuY,35139
91
91
  openedx_tagging/__init__.py,sha256=V9N8M7f9LYlAbA_DdPUsHzTnWjYRXKGa5qHw9P1JnNI,30
92
92
  openedx_tagging/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
93
93
  openedx_tagging/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -96,7 +96,7 @@ openedx_tagging/core/tagging/admin.py,sha256=Ngc2l9Mf6gkzmqu7aOwq-d0mgV8szx0GzSe
96
96
  openedx_tagging/core/tagging/api.py,sha256=zOYBy5hm4Sza6vcXRjMZt0DsVOIxZqfo_tilaFLqIJs,20095
97
97
  openedx_tagging/core/tagging/apps.py,sha256=-gp0VYqX4XQzwjjd-G68Ev2Op0INLh9Byz5UOqF5_7k,345
98
98
  openedx_tagging/core/tagging/data.py,sha256=421EvmDzdM7H523dBVQk4J0W_UwTT4U5syqPRXUYK4g,1353
99
- openedx_tagging/core/tagging/rules.py,sha256=4XpwAoqnAG08rjpxK0G9-PyA7F4Wmkn8Navd9EnKRxo,6605
99
+ openedx_tagging/core/tagging/rules.py,sha256=GkQLMYX8EPAIzFodTRTxtNI6rDNMyFWGu3NS9G33AyQ,6657
100
100
  openedx_tagging/core/tagging/urls.py,sha256=-0Nzmh0mlF9-GgEuocwBdSJn6n8EINnxR4m4pmPou44,159
101
101
  openedx_tagging/core/tagging/import_export/__init__.py,sha256=q5K4JalFQlJxAFUFyqhLY5zQtAskDnRM1H_aVuP_E3Q,83
102
102
  openedx_tagging/core/tagging/import_export/actions.py,sha256=n007-M59D0mXYcwi9CDldDDy5JHAaGCVv9dQbiY4pZ4,13275
@@ -143,7 +143,7 @@ openedx_tagging/core/tagging/rest_api/v1/serializers.py,sha256=0HQD_Jrf6-YpocYfz
143
143
  openedx_tagging/core/tagging/rest_api/v1/urls.py,sha256=dNUKCtUCx_YzrwlbEbpDfjGVQbb2QdJ1VuJCkladj6E,752
144
144
  openedx_tagging/core/tagging/rest_api/v1/views.py,sha256=Hf92cy-tE767DE9FgsZcPKiCYrf5ihfETz8qGKBnuiU,36278
145
145
  openedx_tagging/core/tagging/rest_api/v1/views_import.py,sha256=kbHUPe5A6WaaJ3J1lFIcYCt876ecLNQfd19m7YYub6c,1470
146
- openedx_learning-0.25.0.dist-info/METADATA,sha256=rmB371B58VVRJ5nrps1VFxqAdI8uMm0oMvpaAi5Uj2g,9032
147
- openedx_learning-0.25.0.dist-info/WHEEL,sha256=Td9E1opt19FSuwsk_gcDwtsGPmyXw7uz9xQf-y2gvl8,109
148
- openedx_learning-0.25.0.dist-info/top_level.txt,sha256=IYFbr5mgiEHd-LOtZmXj3q3a0bkGK1M9LY7GXgnfi4M,33
149
- openedx_learning-0.25.0.dist-info/RECORD,,
146
+ openedx_learning-0.26.0.dist-info/METADATA,sha256=c8OUFRhcuUhOqInl5uLmPhAutB08-Z0zbjhWw5j1br8,9032
147
+ openedx_learning-0.26.0.dist-info/WHEEL,sha256=XAkygS4h1cf0JYWV13kJhTWht2y9NqKAsZuiTHc2920,109
148
+ openedx_learning-0.26.0.dist-info/top_level.txt,sha256=IYFbr5mgiEHd-LOtZmXj3q3a0bkGK1M9LY7GXgnfi4M,33
149
+ openedx_learning-0.26.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (79.0.0)
2
+ Generator: setuptools (80.0.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py2-none-any
5
5
  Tag: py3-none-any
@@ -112,7 +112,7 @@ def can_view_object_tag(
112
112
 
113
113
  # Checks the permission for the taxonomy
114
114
  taxonomy_perm = user.has_perm(
115
- "oel_tagging.view_objecttag_taxonomy", perm_obj.taxonomy
115
+ "oel_tagging.view_objecttag_taxonomy", perm_obj.taxonomy # type: ignore[arg-type]
116
116
  )
117
117
  if not taxonomy_perm:
118
118
  return False
@@ -160,7 +160,7 @@ def can_change_object_tag(
160
160
 
161
161
  # Checks the permission for the taxonomy
162
162
  taxonomy_perm = user.has_perm(
163
- "oel_tagging.change_objecttag_taxonomy", perm_obj.taxonomy
163
+ "oel_tagging.change_objecttag_taxonomy", perm_obj.taxonomy # type: ignore[arg-type]
164
164
  )
165
165
  if not taxonomy_perm:
166
166
  return False