-
Notifications
You must be signed in to change notification settings - Fork 54
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
Add StudioContentNode class to allow scripted curation of existing content from Studio #412
Add StudioContentNode class to allow scripted curation of existing content from Studio #412
Conversation
@@ -615,6 +619,68 @@ def validate(self): | |||
assert len(tag) <= 30, ( | |||
"ERROR: tag " + tag + " is too long. Tags should be 30 chars or less." | |||
) | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was just moved up from a subclass to ensure it gets run for all node types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(same with the "role" stuff above)
d85aa7a
to
d464ee9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good to me and the examples make it clear how it can be used - just had non-blocking thought on the example code.
One thought was that it might be a bit more consistent and clear to use Studio
in place of Remote
in the naming scheme since that's where we're getting the node from.
examples/remotecontent/sushichef.py
Outdated
|
||
SOURCE_DOMAIN = "testdomain.org" ## change me! | ||
|
||
original_channel_data = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I read through this it was odd that this null-filled dict was being referenced in a class definition until I got to the bottom and saw how the values were being set before the constructor call.
I think that this would read a bit more clearly if the values for this were passed as kwargs to the CuratedChannelChef constructor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason for this was that we need somewhere "global" to store the computed IDs that are generated during the creation of the original channel -- which would be messy to pull out later through introspection of that channel.
In terms of how they then get passed into the curated chef, I agree that arguments would be nicer. But currently the kwargs passed into a chef constructor are then just ignored completely and not stored anywhere. There are lots of things around these ricecooker idioms I'd love to rearchitect, but I was picking my battles for this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(For now I'll add a comment here to make this clearer, though)
Yeah, this was @rtibbles' recommendation to match the naming pattern of |
This change seems fine, but the backcompat alias would be helpful. Then in 3 years' time when we allow ricecooker to run against Kolibri we can rename it to |
|
In order to support the ability to create a new channel that includes content nodes that already exist on Kolibri Studio, this PR introduces a new node class called
StudioContentNode
, which is provided with a reference to the IDs of content nodes that already exist on Studio, along with potential overrides of existing metadata such as the title, tags, or thumbnail. Studio then clones the existing node from its source channel and puts it into the appropriate spot in this newly cheffed channel.This PR depends on changes @rtibbles shall shortly open a PR for on https://github.com/learningequality/studio.