openedx-learning 0.22.0__py2.py3-none-any.whl → 0.23.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.
- openedx_learning/__init__.py +1 -1
- openedx_learning/apps/authoring/publishing/admin.py +76 -1
- openedx_learning/apps/authoring/publishing/api.py +333 -24
- openedx_learning/apps/authoring/publishing/contextmanagers.py +157 -0
- openedx_learning/apps/authoring/publishing/migrations/0006_draftchangelog.py +68 -0
- openedx_learning/apps/authoring/publishing/migrations/0007_bootstrap_draftchangelog.py +94 -0
- openedx_learning/apps/authoring/publishing/migrations/0008_alter_draftchangelogrecord_options_and_more.py +32 -0
- openedx_learning/apps/authoring/publishing/models/__init__.py +2 -2
- openedx_learning/apps/authoring/publishing/models/draft_log.py +315 -0
- openedx_learning/apps/authoring/publishing/models/publish_log.py +44 -0
- {openedx_learning-0.22.0.dist-info → openedx_learning-0.23.1.dist-info}/METADATA +4 -4
- {openedx_learning-0.22.0.dist-info → openedx_learning-0.23.1.dist-info}/RECORD +15 -11
- openedx_learning/apps/authoring/publishing/models/draft_published.py +0 -95
- {openedx_learning-0.22.0.dist-info → openedx_learning-0.23.1.dist-info}/WHEEL +0 -0
- {openedx_learning-0.22.0.dist-info → openedx_learning-0.23.1.dist-info}/licenses/LICENSE.txt +0 -0
- {openedx_learning-0.22.0.dist-info → openedx_learning-0.23.1.dist-info}/top_level.txt +0 -0
|
@@ -104,3 +104,47 @@ class PublishLogRecord(models.Model):
|
|
|
104
104
|
]
|
|
105
105
|
verbose_name = "Publish Log Record"
|
|
106
106
|
verbose_name_plural = "Publish Log Records"
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
class Published(models.Model):
|
|
110
|
+
"""
|
|
111
|
+
Find the currently published version of an entity.
|
|
112
|
+
|
|
113
|
+
Notes:
|
|
114
|
+
|
|
115
|
+
* There is only ever one published PublishableEntityVersion per
|
|
116
|
+
PublishableEntity at any given time.
|
|
117
|
+
* It may be possible for a PublishableEntity to exist only as a Draft (and thus
|
|
118
|
+
not show up in this table).
|
|
119
|
+
* If a row exists for a PublishableEntity, but the ``version`` field is
|
|
120
|
+
None, it means that the entity was published at some point, but is no
|
|
121
|
+
longer published now–i.e. it's functionally "deleted", even though all
|
|
122
|
+
the version history is preserved behind the scenes.
|
|
123
|
+
|
|
124
|
+
TODO: Do we need to create a (redundant) title field in this model so that
|
|
125
|
+
we can more efficiently search across titles within a LearningPackage?
|
|
126
|
+
Probably not an immediate concern because the number of rows currently
|
|
127
|
+
shouldn't be > 10,000 in the more extreme cases.
|
|
128
|
+
|
|
129
|
+
TODO: Do we need to make a "most_recently" published version when an entry
|
|
130
|
+
is unpublished/deleted?
|
|
131
|
+
"""
|
|
132
|
+
|
|
133
|
+
entity = models.OneToOneField(
|
|
134
|
+
PublishableEntity,
|
|
135
|
+
on_delete=models.CASCADE,
|
|
136
|
+
primary_key=True,
|
|
137
|
+
)
|
|
138
|
+
version = models.OneToOneField(
|
|
139
|
+
PublishableEntityVersion,
|
|
140
|
+
on_delete=models.RESTRICT,
|
|
141
|
+
null=True,
|
|
142
|
+
)
|
|
143
|
+
publish_log_record = models.ForeignKey(
|
|
144
|
+
PublishLogRecord,
|
|
145
|
+
on_delete=models.RESTRICT,
|
|
146
|
+
)
|
|
147
|
+
|
|
148
|
+
class Meta:
|
|
149
|
+
verbose_name = "Published Entity"
|
|
150
|
+
verbose_name_plural = "Published Entities"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: openedx-learning
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.23.1
|
|
4
4
|
Summary: Open edX Learning Core and Tagging.
|
|
5
5
|
Home-page: https://github.com/openedx/openedx-learning
|
|
6
6
|
Author: David Ormsbee
|
|
@@ -20,11 +20,11 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
20
20
|
Requires-Python: >=3.11
|
|
21
21
|
License-File: LICENSE.txt
|
|
22
22
|
Requires-Dist: attrs
|
|
23
|
-
Requires-Dist: rules<4.0
|
|
24
|
-
Requires-Dist: djangorestframework<4.0
|
|
25
|
-
Requires-Dist: celery
|
|
26
23
|
Requires-Dist: Django
|
|
27
24
|
Requires-Dist: edx-drf-extensions
|
|
25
|
+
Requires-Dist: celery
|
|
26
|
+
Requires-Dist: rules<4.0
|
|
27
|
+
Requires-Dist: djangorestframework<4.0
|
|
28
28
|
Dynamic: author
|
|
29
29
|
Dynamic: author-email
|
|
30
30
|
Dynamic: classifier
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
openedx_learning/__init__.py,sha256=
|
|
1
|
+
openedx_learning/__init__.py,sha256=U0-MtvTb7-MpDx0zi9AhepGePH3oI3FKWsiFGVLf9j8,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=AuEegFTT3tAer_3zSxcxqLq3Yd_eilk-Hxt4ESYearA,970
|
|
@@ -36,21 +36,25 @@ openedx_learning/apps/authoring/contents/models.py,sha256=8CYrHK7CZ4U3F7Den4ZV_a
|
|
|
36
36
|
openedx_learning/apps/authoring/contents/migrations/0001_initial.py,sha256=FtOTmIGX2KHpjw-PHbfRjxkFEomI5CEDhNKCZ7IpFeE,3060
|
|
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
|
-
openedx_learning/apps/authoring/publishing/admin.py,sha256=
|
|
40
|
-
openedx_learning/apps/authoring/publishing/api.py,sha256=
|
|
39
|
+
openedx_learning/apps/authoring/publishing/admin.py,sha256=sLmtttaYIQi8XWw_wOdDD9xbF34g1giMEj5yIN-b-4M,7012
|
|
40
|
+
openedx_learning/apps/authoring/publishing/api.py,sha256=14JojKz57Vl_16JwWcDSOM9JzZm6h0sxAmldmb3SVeE,55712
|
|
41
41
|
openedx_learning/apps/authoring/publishing/apps.py,sha256=v9PTe3YoICaYT9wfu268ZkVAlnZFvxi-DqYdbRi25bY,750
|
|
42
|
+
openedx_learning/apps/authoring/publishing/contextmanagers.py,sha256=AH5zhr0Tz_gUG9--dfr_oZAu8DMy94n6mnOJuPbWkeU,6723
|
|
42
43
|
openedx_learning/apps/authoring/publishing/migrations/0001_initial.py,sha256=wvekNV19YRSdxRmQaFnLSn_nCsQlHIucPDVMmgKf_OE,9272
|
|
43
44
|
openedx_learning/apps/authoring/publishing/migrations/0002_alter_learningpackage_key_and_more.py,sha256=toI7qJhNukk6hirKfFx9EpqTpzF2O2Yq1VpFJusDn2M,806
|
|
44
45
|
openedx_learning/apps/authoring/publishing/migrations/0003_containers.py,sha256=k5P1LFkjQT-42yyHE2f57dAMQKafLuJCTRaCBMKWcjc,2519
|
|
45
46
|
openedx_learning/apps/authoring/publishing/migrations/0004_publishableentity_can_stand_alone.py,sha256=RapDZKcjTp5QGgob9DUaf-zl_pQgg-5nz8PZWoXMlVA,549
|
|
46
47
|
openedx_learning/apps/authoring/publishing/migrations/0005_alter_entitylistrow_options.py,sha256=Pp4O-VSI75n3UTZZW6CU4TOVIVc5lZvUg5YfMvZyrYM,377
|
|
48
|
+
openedx_learning/apps/authoring/publishing/migrations/0006_draftchangelog.py,sha256=TdioE59_fXCf4ykWhXJfEjyxdDmqbbbLCwLeT1C9irA,3497
|
|
49
|
+
openedx_learning/apps/authoring/publishing/migrations/0007_bootstrap_draftchangelog.py,sha256=EoFFSv52CeiuMGf3KmBvr34sx9N-tv8afdXWVR8wPFA,4154
|
|
50
|
+
openedx_learning/apps/authoring/publishing/migrations/0008_alter_draftchangelogrecord_options_and_more.py,sha256=5Xm5EV3HvnguLC2UbMTyt_I3q9iI4ZBH0YoNEpNipFI,1207
|
|
47
51
|
openedx_learning/apps/authoring/publishing/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
48
|
-
openedx_learning/apps/authoring/publishing/models/__init__.py,sha256=
|
|
52
|
+
openedx_learning/apps/authoring/publishing/models/__init__.py,sha256=ZhpKo4F30VJatp1F-jQSJnKw8AeHFig9E9SlGnxxBCc,1108
|
|
49
53
|
openedx_learning/apps/authoring/publishing/models/container.py,sha256=GCUD3WTlgvgZSQOKcoOsfhNAfc5pz3Wbs9ClE9mhtB0,2594
|
|
50
|
-
openedx_learning/apps/authoring/publishing/models/
|
|
54
|
+
openedx_learning/apps/authoring/publishing/models/draft_log.py,sha256=7hpbtnnc3yD_3YpH7uqO91FC5KYQkNxtBFSewkIf_AQ,13670
|
|
51
55
|
openedx_learning/apps/authoring/publishing/models/entity_list.py,sha256=8MyJqDdC8dqJY-N9UAu-WS-ZeFOYuRNMKloSY9wMH1w,3042
|
|
52
56
|
openedx_learning/apps/authoring/publishing/models/learning_package.py,sha256=1fuNLHD6k0qGuL0jXYGf4-TA5WczgxJrXUdAIM_JNBI,2688
|
|
53
|
-
openedx_learning/apps/authoring/publishing/models/publish_log.py,sha256
|
|
57
|
+
openedx_learning/apps/authoring/publishing/models/publish_log.py,sha256=QD7Fb00yUMWM4HHae_m60JW-TDX8upbQdWCEIdhB0yE,5615
|
|
54
58
|
openedx_learning/apps/authoring/publishing/models/publishable_entity.py,sha256=-6Fde_sYqaq1AUC4sw4Rf1X9Hh4jun2Py7Xhsl4VWuY,25419
|
|
55
59
|
openedx_learning/apps/authoring/units/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
56
60
|
openedx_learning/apps/authoring/units/api.py,sha256=KJA7Bh7IBE22E6cMSZNp6pamjjA1Vf8EhHw0rvQtlPM,9797
|
|
@@ -71,7 +75,7 @@ openedx_learning/lib/fields.py,sha256=eiGoXMPhRuq25EH2qf6BAODshAQE3DBVdIYAMIUAXW
|
|
|
71
75
|
openedx_learning/lib/managers.py,sha256=-Q3gxalSqyPZ9Im4DTROW5tF8wVTZLlmfTe62_xmowY,1643
|
|
72
76
|
openedx_learning/lib/test_utils.py,sha256=g3KLuepIZbaDBCsaj9711YuqyUx7LD4gXDcfNC-mWdc,527
|
|
73
77
|
openedx_learning/lib/validators.py,sha256=iqEdEAvFV2tC7Ecssx69kjecpdU8nE87AlDJYrqrsnc,404
|
|
74
|
-
openedx_learning-0.
|
|
78
|
+
openedx_learning-0.23.1.dist-info/licenses/LICENSE.txt,sha256=QTW2QN7q3XszgUAXm9Dzgtu5LXYKbR1SGnqMa7ufEuY,35139
|
|
75
79
|
openedx_tagging/__init__.py,sha256=V9N8M7f9LYlAbA_DdPUsHzTnWjYRXKGa5qHw9P1JnNI,30
|
|
76
80
|
openedx_tagging/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
77
81
|
openedx_tagging/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -127,7 +131,7 @@ openedx_tagging/core/tagging/rest_api/v1/serializers.py,sha256=0HQD_Jrf6-YpocYfz
|
|
|
127
131
|
openedx_tagging/core/tagging/rest_api/v1/urls.py,sha256=dNUKCtUCx_YzrwlbEbpDfjGVQbb2QdJ1VuJCkladj6E,752
|
|
128
132
|
openedx_tagging/core/tagging/rest_api/v1/views.py,sha256=Hf92cy-tE767DE9FgsZcPKiCYrf5ihfETz8qGKBnuiU,36278
|
|
129
133
|
openedx_tagging/core/tagging/rest_api/v1/views_import.py,sha256=kbHUPe5A6WaaJ3J1lFIcYCt876ecLNQfd19m7YYub6c,1470
|
|
130
|
-
openedx_learning-0.
|
|
131
|
-
openedx_learning-0.
|
|
132
|
-
openedx_learning-0.
|
|
133
|
-
openedx_learning-0.
|
|
134
|
+
openedx_learning-0.23.1.dist-info/METADATA,sha256=4BwlvkX7Uk-Nxt1yBCzarwd79d6GeATiexL4SOjyfG0,9032
|
|
135
|
+
openedx_learning-0.23.1.dist-info/WHEEL,sha256=MAQBAzGbXNI3bUmkDsiV_duv8i-gcdnLzw7cfUFwqhU,109
|
|
136
|
+
openedx_learning-0.23.1.dist-info/top_level.txt,sha256=IYFbr5mgiEHd-LOtZmXj3q3a0bkGK1M9LY7GXgnfi4M,33
|
|
137
|
+
openedx_learning-0.23.1.dist-info/RECORD,,
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Draft and Published models
|
|
3
|
-
"""
|
|
4
|
-
from django.db import models
|
|
5
|
-
|
|
6
|
-
from .publish_log import PublishLogRecord
|
|
7
|
-
from .publishable_entity import PublishableEntity, PublishableEntityVersion
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class Draft(models.Model):
|
|
11
|
-
"""
|
|
12
|
-
Find the active draft version of an entity (usually most recently created).
|
|
13
|
-
|
|
14
|
-
This model mostly only exists to allow us to join against a bunch of
|
|
15
|
-
PublishableEntity objects at once and get all their latest drafts. You might
|
|
16
|
-
use this together with Published in order to see which Drafts haven't been
|
|
17
|
-
published yet.
|
|
18
|
-
|
|
19
|
-
A Draft entry should be created whenever a new PublishableEntityVersion is
|
|
20
|
-
created. This means there are three possible states:
|
|
21
|
-
|
|
22
|
-
1. No Draft entry for a PublishableEntity: This means a PublishableEntity
|
|
23
|
-
was created, but no PublishableEntityVersion was ever made for it, so
|
|
24
|
-
there was never a Draft version.
|
|
25
|
-
2. A Draft entry exists and points to a PublishableEntityVersion: This is
|
|
26
|
-
the most common state.
|
|
27
|
-
3. A Draft entry exists and points to a null version: This means a version
|
|
28
|
-
used to be the draft, but it's been functionally "deleted". The versions
|
|
29
|
-
still exist in our history, but we're done using it.
|
|
30
|
-
|
|
31
|
-
It would have saved a little space to add this data to the Published model
|
|
32
|
-
(and possibly call the combined model something else). Split Modulestore did
|
|
33
|
-
this with its active_versions table. I keep it separate here to get a better
|
|
34
|
-
separation of lifecycle events: i.e. this table *only* changes when drafts
|
|
35
|
-
are updated, not when publishing happens. The Published model only changes
|
|
36
|
-
when something is published.
|
|
37
|
-
"""
|
|
38
|
-
# If we're removing a PublishableEntity entirely, also remove the Draft
|
|
39
|
-
# entry for it. This isn't a normal operation, but can happen if you're
|
|
40
|
-
# deleting an entire LearningPackage.
|
|
41
|
-
entity = models.OneToOneField(
|
|
42
|
-
PublishableEntity,
|
|
43
|
-
on_delete=models.CASCADE,
|
|
44
|
-
primary_key=True,
|
|
45
|
-
)
|
|
46
|
-
version = models.OneToOneField(
|
|
47
|
-
PublishableEntityVersion,
|
|
48
|
-
on_delete=models.RESTRICT,
|
|
49
|
-
null=True,
|
|
50
|
-
blank=True,
|
|
51
|
-
)
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
class Published(models.Model):
|
|
55
|
-
"""
|
|
56
|
-
Find the currently published version of an entity.
|
|
57
|
-
|
|
58
|
-
Notes:
|
|
59
|
-
|
|
60
|
-
* There is only ever one published PublishableEntityVersion per
|
|
61
|
-
PublishableEntity at any given time.
|
|
62
|
-
* It may be possible for a PublishableEntity to exist only as a Draft (and thus
|
|
63
|
-
not show up in this table).
|
|
64
|
-
* If a row exists for a PublishableEntity, but the ``version`` field is
|
|
65
|
-
None, it means that the entity was published at some point, but is no
|
|
66
|
-
longer published now–i.e. it's functionally "deleted", even though all
|
|
67
|
-
the version history is preserved behind the scenes.
|
|
68
|
-
|
|
69
|
-
TODO: Do we need to create a (redundant) title field in this model so that
|
|
70
|
-
we can more efficiently search across titles within a LearningPackage?
|
|
71
|
-
Probably not an immediate concern because the number of rows currently
|
|
72
|
-
shouldn't be > 10,000 in the more extreme cases.
|
|
73
|
-
|
|
74
|
-
TODO: Do we need to make a "most_recently" published version when an entry
|
|
75
|
-
is unpublished/deleted?
|
|
76
|
-
"""
|
|
77
|
-
|
|
78
|
-
entity = models.OneToOneField(
|
|
79
|
-
PublishableEntity,
|
|
80
|
-
on_delete=models.CASCADE,
|
|
81
|
-
primary_key=True,
|
|
82
|
-
)
|
|
83
|
-
version = models.OneToOneField(
|
|
84
|
-
PublishableEntityVersion,
|
|
85
|
-
on_delete=models.RESTRICT,
|
|
86
|
-
null=True,
|
|
87
|
-
)
|
|
88
|
-
publish_log_record = models.ForeignKey(
|
|
89
|
-
PublishLogRecord,
|
|
90
|
-
on_delete=models.RESTRICT,
|
|
91
|
-
)
|
|
92
|
-
|
|
93
|
-
class Meta:
|
|
94
|
-
verbose_name = "Published Entity"
|
|
95
|
-
verbose_name_plural = "Published Entities"
|
|
File without changes
|
{openedx_learning-0.22.0.dist-info → openedx_learning-0.23.1.dist-info}/licenses/LICENSE.txt
RENAMED
|
File without changes
|
|
File without changes
|