Skip to content

Add support to internal.py node endpoint for metadata labels #3356

@rtibbles

Description

@rtibbles

Currently, the Studio internal API used by Ricecooker does not support adding the new metadata labels.

We need to update the internal API to handle the following fields:

    grade_levels
    resource_types
    learning_activities
    accessibility_labels
    categories
    learner_needs

As detailed here: https://github.com/learningequality/studio/blob/unstable/contentcuration/contentcuration/models.py#L1150 these fields are stored as a map.

This API should be updated to accept these six fields, it might be easier to accept them as an array and then save them as the map internally.
https://github.com/learningequality/studio/blob/unstable/contentcuration/contentcuration/views/internal.py#L268

They should also be validated to ensure that the values passed in match the values in le_utils. They are all imported from le_utils.constants.labels with the following field to module mapping:

    grade_levels : levels
    resource_types : resource_type
    learning_activities : learning_activities
    accessibility_labels : accessibility_categories
    categories : subjects
    learner_needs : needs

For an example of these being used see the main contentnode API endpoint: https://github.com/learningequality/studio/blob/unstable/contentcuration/contentcuration/viewsets/contentnode.py#L302

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions