-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Libraries] [Collections] [Backend] API to associate library component(s) with collection(s) #227
Comments
@ormsbee I'm planning on implementing this task next sprint (20 Aug - 1 Sep). Do you have time to CC review the openedx-learning changes and maybe edx-platform too? |
@pomegranited: Sure! |
@pomegranited: I have an abandoned PR from back when we thought we'd do a tag-based approach to this, in case it's helpful: https://github.com/openedx/openedx-learning/pull/131/files |
Thanks for this! There's a lot more in there than what is specified in this ticket description. How much do you want me to do here? Specifically:
Thanks for your input! |
No. In fact, the way they're currently envisioned, they explicitly shouldn't be. They aren't in the PR I linked.
Yes. They should be linked to the PublishableEntity, not the PublishableEntityVersion. I think there's an edge case here around soft-deletion: Does soft-deleting (i.e. setting the draft version to null) a PublishableEntity mean that it is removed from all Collections? If I soft-delete something today and make a new entity with the same key, it will treat it as a new version of the same PublishableEntity. So if I soft-delete something that was in a Collection, and then create a new thing that exactly matches the key, should it go back into all the Collections it was a part of originally?
It's out of scope for MVP, but may be something we'll look into later. |
Ach sorry.. I skimmed
👍
Creating a new entity with the same key is one use case, but your code comments mention a more common use case where a soft-deleted PublishableEntity is "un-deleted" and restored back to the most recent PublishableEntityVersion. So I think that when a PublishableEntity is soft deleted, we have to preserve the link between the Collection and the PublishableEntity just in case it gets un-soft-deleted. But that means that we can't really get around the other use case, where a re-created PublishableEntity re-appears in all the Collections it was previously linked to. But a content author could always explicitly remove a re-created PublishableEntity from their Collection if they don't want it there anymore. @ormsbee Am I reading this right? |
Oh right, good point.
Yeah, I think that's fine. I mean, I guess we could do the actual "remove from Collection" after they publish a delete (because they wouldn't be able to revert at that point). But it's probably not worthwhile to do that yet–I'm honestly not even sure what the desirable behavior would be in my obscure "re-create the same component" use case. And as you point out, there's a really simple workaround to that default behavior if anyone runs across it. |
This step involves implementing a way to associate library component(s) with one or more collection(s).
CollectionObject
Model with the following fields inopenedx_learning
:collection_id
- ForeignKey toCollection
instanceobject_id
- ForeignKey toPublishableEntity
instance (e.g. library component). This would allow for adding other publishable items (like units + sections) to collections in the future.openedx-learning
that can associate a [set of] publishable entities with a [set of] collections, or remove an entity/entities from the given collection(s)content_libraries
django app that can do the same as 2 for library components, with permissions checks.CONTENT_OBJECT_TAGS_CHANGED
event, if we think of collections as a sort of special tag.modified
timestamp.The text was updated successfully, but these errors were encountered: