openedx-learning 0.6.0__py2.py3-none-any.whl → 0.6.1__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.
@@ -1,4 +1,4 @@
1
1
  """
2
2
  Open edX Learning ("Learning Core").
3
3
  """
4
- __version__ = "0.6.0"
4
+ __version__ = "0.6.1"
@@ -51,7 +51,7 @@ def create_component(
51
51
  """
52
52
  Create a new Component (an entity like a Problem or Video)
53
53
  """
54
- key = f"{component_type.namespace}:{component_type.name}@{local_key}"
54
+ key = f"{component_type.namespace}:{component_type.name}:{local_key}"
55
55
  with atomic():
56
56
  publishable_entity = publishing_api.create_publishable_entity(
57
57
  learning_package_id, key, created, created_by
@@ -0,0 +1,20 @@
1
+ # Generated by Django 4.2.10 on 2024-02-14 22:02
2
+
3
+ from django.db import migrations
4
+
5
+ import openedx_learning.lib.fields
6
+
7
+
8
+ class Migration(migrations.Migration):
9
+
10
+ dependencies = [
11
+ ('oel_components', '0001_initial'),
12
+ ]
13
+
14
+ operations = [
15
+ migrations.AlterField(
16
+ model_name='componentversioncontent',
17
+ name='key',
18
+ field=openedx_learning.lib.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_bin', 'sqlite': 'BINARY'}, db_column='_key', max_length=500),
19
+ ),
20
+ ]
@@ -237,7 +237,13 @@ class ComponentVersionContent(models.Model):
237
237
  content = models.ForeignKey(Content, on_delete=models.RESTRICT)
238
238
 
239
239
  uuid = immutable_uuid_field()
240
- key = key_field()
240
+
241
+ # "key" is a reserved word for MySQL, so we're temporarily using the column
242
+ # name of "_key" to avoid breaking downstream tooling. A possible
243
+ # alternative name for this would be "path", since it's most often used as
244
+ # an internal file path. However, we might also want to put special
245
+ # identifiers that don't map as cleanly to file paths at some point.
246
+ key = key_field(db_column="_key")
241
247
 
242
248
  # Long explanation for the ``learner_downloadable`` field:
243
249
  #
@@ -0,0 +1,25 @@
1
+ # Generated by Django 4.2.10 on 2024-02-14 22:02
2
+
3
+ from django.db import migrations
4
+
5
+ import openedx_learning.lib.fields
6
+
7
+
8
+ class Migration(migrations.Migration):
9
+
10
+ dependencies = [
11
+ ('oel_publishing', '0001_initial'),
12
+ ]
13
+
14
+ operations = [
15
+ migrations.AlterField(
16
+ model_name='learningpackage',
17
+ name='key',
18
+ field=openedx_learning.lib.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_bin', 'sqlite': 'BINARY'}, db_column='_key', max_length=500),
19
+ ),
20
+ migrations.AlterField(
21
+ model_name='publishableentity',
22
+ name='key',
23
+ field=openedx_learning.lib.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_bin', 'sqlite': 'BINARY'}, db_column='_key', max_length=500),
24
+ ),
25
+ ]
@@ -38,7 +38,14 @@ class LearningPackage(models.Model): # type: ignore[django-manager-missing]
38
38
  id = models.AutoField(primary_key=True)
39
39
 
40
40
  uuid = immutable_uuid_field()
41
- key = key_field()
41
+
42
+ # "key" is a reserved word for MySQL, so we're temporarily using the column
43
+ # name of "_key" to avoid breaking downstream tooling. There's an open
44
+ # question as to whether this field needs to exist at all, or whether the
45
+ # top level library key it's currently used for should be entirely in the
46
+ # LibraryContent model.
47
+ key = key_field(db_column="_key")
48
+
42
49
  title = case_insensitive_char_field(max_length=500, blank=False)
43
50
 
44
51
  # TODO: We should probably defer this field, since many things pull back
@@ -172,7 +179,12 @@ class PublishableEntity(models.Model):
172
179
  on_delete=models.CASCADE,
173
180
  related_name="publishable_entities",
174
181
  )
175
- key = key_field()
182
+
183
+ # "key" is a reserved word for MySQL, so we're temporarily using the column
184
+ # name of "_key" to avoid breaking downstream tooling. Consider renaming
185
+ # this later.
186
+ key = key_field(db_column="_key")
187
+
176
188
  created = manual_date_time_field()
177
189
  created_by = models.ForeignKey(
178
190
  settings.AUTH_USER_MODEL,
@@ -109,7 +109,7 @@ def immutable_uuid_field() -> models.UUIDField:
109
109
  )
110
110
 
111
111
 
112
- def key_field() -> MultiCollationCharField:
112
+ def key_field(**kwargs) -> MultiCollationCharField:
113
113
  """
114
114
  Externally created Identifier fields.
115
115
 
@@ -120,7 +120,7 @@ def key_field() -> MultiCollationCharField:
120
120
  Other apps should *not* make references to these values directly, since
121
121
  these values may in theory change (even if this is rare in practice).
122
122
  """
123
- return case_sensitive_char_field(max_length=500, blank=False)
123
+ return case_sensitive_char_field(max_length=500, blank=False, **kwargs)
124
124
 
125
125
 
126
126
  def hash_field() -> models.CharField:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: openedx-learning
3
- Version: 0.6.0
3
+ Version: 0.6.1
4
4
  Summary: An experiment.
5
5
  Home-page: https://github.com/openedx/openedx-learning
6
6
  Author: David Ormsbee
@@ -17,12 +17,12 @@ Classifier: Natural Language :: English
17
17
  Classifier: Programming Language :: Python :: 3
18
18
  Classifier: Programming Language :: Python :: 3.8
19
19
  Requires-Python: >=3.8
20
- Requires-Dist: edx-drf-extensions
21
- Requires-Dist: attrs
22
20
  Requires-Dist: Django (<5.0)
23
- Requires-Dist: celery
24
- Requires-Dist: djangorestframework (<4.0)
25
21
  Requires-Dist: rules (<4.0)
22
+ Requires-Dist: djangorestframework (<4.0)
23
+ Requires-Dist: attrs
24
+ Requires-Dist: edx-drf-extensions
25
+ Requires-Dist: celery
26
26
 
27
27
  openedx-learning
28
28
  =============================
@@ -1,4 +1,4 @@
1
- openedx_learning/__init__.py,sha256=11W0yK6VQ2Sghj3ZMU64TRxMwmEBKPtxfeNCBBxGoUU,67
1
+ openedx_learning/__init__.py,sha256=4Akvu3WuVTtV-T_BQb8iO3zg_KBv_PDEc1owlfudTlQ,67
2
2
  openedx_learning/contrib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  openedx_learning/contrib/media_server/__init__.py,sha256=iYijWFCl5RNR9omSu22kMl49EfponoqXBqXr0HMp4QI,56
4
4
  openedx_learning/contrib/media_server/apps.py,sha256=FPT0rsUFtPyhFpWKjSI1e_s58wU0IbDyaAW_66V6sY4,816
@@ -7,10 +7,11 @@ openedx_learning/contrib/media_server/views.py,sha256=V-eq0SFi5815lkGdRz8dye4fF3
7
7
  openedx_learning/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
8
  openedx_learning/core/components/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  openedx_learning/core/components/admin.py,sha256=QE7e76C6X2V1AQPxQe6SayQPfCMmbs4RZPEPIGcvTWw,4672
10
- openedx_learning/core/components/api.py,sha256=EW_Did2yHRwKN2yWaZj4yWqdunKCAhSJv4Ob8jz-4dc,12345
10
+ openedx_learning/core/components/api.py,sha256=2ux1s9Bpfvs5sgTViHLagMb1IHpMo_vRR-MbrbXh0_U,12345
11
11
  openedx_learning/core/components/apps.py,sha256=invLeAY0B-d_Ac9xu_b5ZWeb7v5NJe_-938BO9U2-jo,747
12
- openedx_learning/core/components/models.py,sha256=cOMmMdIQNciRqg11a7nZJMaI-7Xsr5ICRn-QTi4xUXA,12779
12
+ openedx_learning/core/components/models.py,sha256=duVLdkTFnM7ixsqXQPlvmqmgf32hYyXdeRw1W7MdOpg,13170
13
13
  openedx_learning/core/components/migrations/0001_initial.py,sha256=446LkJSFeK8J_-l-bxakZ_BVx_CiJIllGcBYqWcEenA,4664
14
+ openedx_learning/core/components/migrations/0002_alter_componentversioncontent_key.py,sha256=98724dtucRjJCRyLt5p45qXYb2d6-ouVGp7PB6zTG6E,539
14
15
  openedx_learning/core/components/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
16
  openedx_learning/core/contents/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
17
  openedx_learning/core/contents/admin.py,sha256=4ILH_cEiAXKUlfPVwJJZeh5yupgF3v7kf-xJ6ZTTFDE,1174
@@ -24,14 +25,15 @@ openedx_learning/core/publishing/admin.py,sha256=F-0QlVQmuovLIF258XK_vKJdOnn7lLa
24
25
  openedx_learning/core/publishing/api.py,sha256=pfBePrmP0jnU5YTt4x7qhT37RN02P95gw2-xQNA_e9A,14254
25
26
  openedx_learning/core/publishing/apps.py,sha256=skY84raPW6gvrb5VPzhrLR2_gIHTUG67tMhSO7umVN4,379
26
27
  openedx_learning/core/publishing/model_mixins.py,sha256=Y6hGh0MKVOx0dUyNL0YkLL9ErUnYI2Nv2ZGMhc3CMng,13412
27
- openedx_learning/core/publishing/models.py,sha256=Vke2fxVIh6P0e6GXm-Shvc1BBXXez4IKyEJ8ipV56IQ,19771
28
+ openedx_learning/core/publishing/models.py,sha256=MGezxLoKFqHYnZccknqWyuNYrgiqu9eGDc4H9yIYzrg,20321
28
29
  openedx_learning/core/publishing/migrations/0001_initial.py,sha256=wvekNV19YRSdxRmQaFnLSn_nCsQlHIucPDVMmgKf_OE,9272
30
+ openedx_learning/core/publishing/migrations/0002_alter_learningpackage_key_and_more.py,sha256=toI7qJhNukk6hirKfFx9EpqTpzF2O2Yq1VpFJusDn2M,806
29
31
  openedx_learning/core/publishing/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
30
32
  openedx_learning/lib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
31
33
  openedx_learning/lib/admin_utils.py,sha256=5z9NrXxmT5j8azx9u1t0AgxV5PIDTc2jPyM5z5yW8cw,4021
32
34
  openedx_learning/lib/cache.py,sha256=ppT36KiPLdsAF3GfZCF0IdiHodckd2gLiF1sNhjSJuk,958
33
35
  openedx_learning/lib/collations.py,sha256=mMUXt6rnKoYOKTIVAVwiIQtWhaNsxRCfdeR25TPeK3U,4325
34
- openedx_learning/lib/fields.py,sha256=DZvpeYW_I9ZeV_dE3DawYW52SGx7Gvr7qVoXCAD2GLg,7504
36
+ openedx_learning/lib/fields.py,sha256=eiGoXMPhRuq25EH2qf6BAODshAQE3DBVdIYAMIUAXW0,7522
35
37
  openedx_learning/lib/managers.py,sha256=ofcUxHS2wsJSFP4CB7OCkN6JiWFxNlIyNh_VDgFtgug,1538
36
38
  openedx_learning/lib/test_utils.py,sha256=g3KLuepIZbaDBCsaj9711YuqyUx7LD4gXDcfNC-mWdc,527
37
39
  openedx_learning/lib/validators.py,sha256=98UldFhFxd77zF1VxzQcOPt0blh64gMZDv-d_uQ67mg,396
@@ -92,8 +94,8 @@ openedx_tagging/core/tagging/rest_api/v1/serializers.py,sha256=I9jk3x3wPIeV_XCyC
92
94
  openedx_tagging/core/tagging/rest_api/v1/urls.py,sha256=dNUKCtUCx_YzrwlbEbpDfjGVQbb2QdJ1VuJCkladj6E,752
93
95
  openedx_tagging/core/tagging/rest_api/v1/views.py,sha256=opPY8xwbOupUaLnX0ovCV-oJ06l-d_qV8CgT47-m-Dc,34358
94
96
  openedx_tagging/core/tagging/rest_api/v1/views_import.py,sha256=kbHUPe5A6WaaJ3J1lFIcYCt876ecLNQfd19m7YYub6c,1470
95
- openedx_learning-0.6.0.dist-info/LICENSE.txt,sha256=QTW2QN7q3XszgUAXm9Dzgtu5LXYKbR1SGnqMa7ufEuY,35139
96
- openedx_learning-0.6.0.dist-info/METADATA,sha256=DQNCjPuDYxV9Z0ZMYgd9Ih6oKNF675zV-YilKQ96dok,8758
97
- openedx_learning-0.6.0.dist-info/WHEEL,sha256=Z-nyYpwrcSqxfdux5Mbn_DQ525iP7J2DG3JgGvOYyTQ,110
98
- openedx_learning-0.6.0.dist-info/top_level.txt,sha256=IYFbr5mgiEHd-LOtZmXj3q3a0bkGK1M9LY7GXgnfi4M,33
99
- openedx_learning-0.6.0.dist-info/RECORD,,
97
+ openedx_learning-0.6.1.dist-info/LICENSE.txt,sha256=QTW2QN7q3XszgUAXm9Dzgtu5LXYKbR1SGnqMa7ufEuY,35139
98
+ openedx_learning-0.6.1.dist-info/METADATA,sha256=yw2xbOghDZ_i09kmUY-TqCnVX3gTYc0KP164ZDzis0E,8758
99
+ openedx_learning-0.6.1.dist-info/WHEEL,sha256=Z-nyYpwrcSqxfdux5Mbn_DQ525iP7J2DG3JgGvOYyTQ,110
100
+ openedx_learning-0.6.1.dist-info/top_level.txt,sha256=IYFbr5mgiEHd-LOtZmXj3q3a0bkGK1M9LY7GXgnfi4M,33
101
+ openedx_learning-0.6.1.dist-info/RECORD,,