kolibri icon indicating copy to clipboard operation
kolibri copied to clipboard

Implement modality field extraction and annotation

Open rtibbles opened this issue 1 month ago • 3 comments

Overview

Add the modality CharField to ContentNode and implement the annotation logic to populate it from the options['modality'] JSON field.

Tasks

  1. Add field to models.py

    • Add modality = models.CharField(max_length=50, blank=True, null=True, db_index=True, choices=modalities.choices) to ContentNode in kolibri/core/content/models.py
    • Import modalities from le_utils.constants
    • Use le_utils.constants.modalities.choices for the field choices
  2. Create migration

    • Generate Django migration for the new field
  3. Create annotation function

    • Add annotate_modality(queryset) function to kolibri/core/content/utils/search.py
    • Extract modality from options JSON and populate the field
  4. Call during channel import

    • Update kolibri/core/content/utils/channel_import.py to call annotate_modality() after annotate_label_bitmasks()
  5. Add upgrade task

    • Add version upgrade function to kolibri/core/content/upgrade.py to backfill existing channels
  6. Generate schema

    • Run kolibri manage generate_schema current to update SQLAlchemy schema

🤖 This issue was written by Claude Code, under supervision, review and final edits by @rtibbles 🤖

rtibbles avatar Dec 04 '25 21:12 rtibbles

Hi! Could you please assign this issue to me? I would be very happy to contribute to your organization

LSUDOKO avatar Dec 06 '25 17:12 LSUDOKO

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.