-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add filter functions to publishing API [FC-0062] (#257)
Adds filter_publishable_entities() to openedx.apps.authoring.publishing.api (and the public openedx.api.authoring package). This also bumps the version to 0.18.0 The motivation for this change is so that other apps can filter their PublishableEntity querysets without having to dig into the internals of the "publishing" app's data model relations. For instance, the "collections" app could already answer the question, "What Publishable Entities are in this Collection?" But to answer the question of, "What are the Publishable Entities in this Collection that have a published version?" requires filtering on "published__version__isnull", which is a level of detail that we don't want to burden other apps with. With this commit, they could call something like this instead: published_entities = filter_publishable_entities( collection.entities(), has_published=True, ) It's possible that this could be done in a more natural way with custom Managers/QuerySets. The main concern there would be to make sure that those come across correctly in various RelatedManagers, e.g. to make sure that something like "Collection.entities" returns the customized version. This is something we can follow up on in the future.
- Loading branch information
Showing
3 changed files
with
95 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
Open edX Learning ("Learning Core"). | ||
""" | ||
|
||
__version__ = "0.17.0" | ||
__version__ = "0.18.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters