Implement modality field extraction and annotation
Overview
Add the modality CharField to ContentNode and implement the annotation logic to populate it from the options['modality'] JSON field.
Tasks
-
Add field to models.py
- Add
modality = models.CharField(max_length=50, blank=True, null=True, db_index=True, choices=modalities.choices)to ContentNode inkolibri/core/content/models.py - Import modalities from
le_utils.constants - Use
le_utils.constants.modalities.choicesfor the field choices
- Add
-
Create migration
- Generate Django migration for the new field
-
Create annotation function
- Add
annotate_modality(queryset)function tokolibri/core/content/utils/search.py - Extract modality from
optionsJSON and populate the field
- Add
-
Call during channel import
- Update
kolibri/core/content/utils/channel_import.pyto callannotate_modality()afterannotate_label_bitmasks()
- Update
-
Add upgrade task
- Add version upgrade function to
kolibri/core/content/upgrade.pyto backfill existing channels
- Add version upgrade function to
-
Generate schema
- Run
kolibri manage generate_schema currentto update SQLAlchemy schema
- Run
🤖 This issue was written by Claude Code, under supervision, review and final edits by @rtibbles 🤖
Hi! Could you please assign this issue to me? I would be very happy to contribute to your organization
Hi! 👋
Thanks so much for your interest! This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues. If there are no unassigned 'help wanted' issues available, please wait until new ones are added.
We really appreciate your willingness to help. 😊
Are you preparing for Google Summer of Code? See our GSoC guidelines.
Season’s greetings! 👋
We’d like to thank everyone for another year of fruitful collaborations, engaging discussions, and for the continued support of our work. Learning Equality will be on holidays from December 22 to January 5. We look forward to much more in the new year and wish you a very happy holiday season!
Are you preparing for Google Summer of Code? See our GSoC guidelines.