Skip to content

[BE] openedx-core - Accept taxonomy_type on Create & Import endpoints #628

Closed

Description

@mgwozdz-unicon

Part of #614. See parent for use case, acceptance criteria, and architecture rationale.

Depends on: data model ticket (CompetencyTaxonomy model must exist) #613

Files to modify

File Change
src/openedx_tagging/rest_api/v1/serializers.py Add taxonomy_type as write_only=True ChoiceField with required=False, choices=["tags", "competency"]. Define the valid-value constants in a shared location so this field and the CBE dispatch logic below can't drift apart.
src/openedx_tagging/rest_api/v1/views.py Update perform_create() and create_import() to surface taxonomy_type from validated data. Do not call CompetencyTaxonomy from this layer.
openedx_learning/applets/cbe/api.py Add create_competency_taxonomy(): call create_taxonomy() then create the linked CompetencyTaxonomy row in transaction.atomic().

Key constraint

openedx_tagging must not import from openedx_learning. The dispatch to
create_competency_taxonomy() must happen at a layer that can see both packages — a
CBE-provided view mixin overriding perform_create() is one viable approach.

Example Resolution Prompt

In src/openedx_tagging/rest_api/v1/serializers.py, add taxonomy_type as a
write-only ChoiceField with required=False and choices=["tags", "competency"];
define the valid-value constants (e.g. TAXONOMY_TYPE_COMPETENCY = "competency") in a
shared location so this field and the CBE dispatch logic below stay in sync. In
src/openedx_tagging/rest_api/v1/views.py, update both perform_create() (around line
262) and the create_import() action to surface taxonomy_type from validated data —
do not call CompetencyTaxonomy directly from this layer. In
openedx_learning/applets/cbe/api.py, add create_competency_taxonomy(): call
create_taxonomy() from openedx_tagging, then create the linked CompetencyTaxonomy
row wrapped in transaction.atomic(). Wire the dispatch to
create_competency_taxonomy() at a layer that can see both packages — a CBE-provided
view mixin overriding perform_create() is one viable approach.

Activity

  1. moved this from Todo to Ready for Community Review in Competency Criteria and Student Progresson Jul 2, 2026
  2. moved this from Ready for Community Review to In Progress in Competency Criteria and Student Progresson Sep 1, 2026
  3. moved this from In Progress to Code Review in Competency Criteria and Student Progresson Sep 3, 2026
  4. moved this from Unicon Code Review to Community Code Review in Competency Criteria and Student Progresson Sep 4, 2026
  5. moved this from Community Code Review to Ready for QA in Competency Criteria and Student Progresson Sep 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions