Skip to content

Create an openedx_catalog app with a representation for CourseRuns #469

Closed

Description

@ormsbee

The Learning Pathways project would benefit from having a representation of CourseRuns in this repo, since the first Pathways will be configured using CourseRuns.

As a migration step, we would push data into this new model from openedx-platform's CourseOverview. At some later point, we can reverse the dependency relationship.

Some high level thoughts/ramblings:

  1. We probably want a very small table because it's going to be joined against a lot in the future. Common metadata should go in 1:1 models that we optionally join on. We want to avoid CourseOverview's "just one more field" syndrome, and try to divide up supplementary data into logical pieces like CourseSchedule.
  2. For phase one, we only need the minimal set of course data needed for Learning Pathways to query.
  3. We could make the initial model more general, e.g. LearningContext, even if we only push the course keys to it for now (and then subclass or 1:1 for CourseRun). I'm not sure if this is really the way we want to go though, because LearningContext feels like it's only a catalog concept by coincidence because of how the system evolved.
  4. We should use actual opaque key Django fields.
  5. I'm guessing we'll want to use RBAC (opeendx-authz)?

Activity

  1. bradenmacdonald commented on Jan 30, 2026

    @bradenmacdonald
    Contributor
  2. bradenmacdonald commented on Feb 3, 2026

    @bradenmacdonald
    Contributor

    Some notes to self from the earlier discussions:

    • Need for grouping CourseRuns together:
      • They often re-use 90+% of the same content, which is part of why I'd like to eventually see multiple runs of the same course stored in the same LearningPackage

      • The Studio course listing page is eventually going to have the runs grouped by course.

      • Right now this concept lives in course-discovery but that comes with a lot of baggage that we don't want. Being able to house a core concept in edx-platform and then push a lot of the rest into things that either plugin or otherwise interface with the core bits here seems like it would make the platform more generically usable.

      • be wary of adding too much additional metadata to these CatalogCourses. Can we draw a bright line around what this is meant and not meant to do? Some things that would be red flags for me: ecommerce (including "entitlements"), certificates, programs (probably).

      • We could say that a CatalogCourse model (or virtual model) to group CourseRun's together exists in the core for the purposes of organizing CourseRuns (in Studio), de-duplicating content storage (internally in openedx_content), and providing primitives (models and events) that higher-level apps/plugins can use (programs, ecommerce, enrollment), but which otherwise don't affect core functionality.
    • Strong desire for the ability to create CourseRuns (for marketing & enrollment) without any attached content yet.
      • To achieve this, we would likely want/need to move some core metadata (start date, enrollment date, etc.) from the platform's Course XBlock to new models attached to CourseRun. See Dave's prev proposal

        The tricky part in that scenario would be figuring out the migration path and what happens to import/export of those fields that already exist in Modulestore. I think it's totally doable, but there are a lot of details to work out.

      • Product question: would we ever also allow creating re-runs of a CatalogCourse that don't have content attached yet? (And then you could create a completely new version of the course instead of modifying a previous run)

    Figure 1: Studio Home Page with course runs grouped together (mockup)

    Image
  3. bradenmacdonald commented on Feb 3, 2026

    @bradenmacdonald
    Contributor

    We could make the initial model more general, e.g. LearningContext, even if we only push the course keys to it for now (and then subclass or 1:1 for CourseRun). I'm not sure if this is really the way we want to go though, because LearningContext feels like it's only a catalog concept by coincidence because of how the system evolved.

    Yeah. If we think of LearningContext as "a context in which we will display learnable content (to learners OR authors) and be able to track user state/grades" (i.e. any context where we render XBlocks), then "content library", "blog post", "course", and perhaps "pathway" are all learning contexts.

    If we define this "catalog" app as something like "core data/models to facilitate learner discovery and enrollment into enrollable things", then courses and pathways would be in scope for it, but other learning contexts like content libraries and the (theoretical) "blog post" context would not.

  4. ormsbee commented on Feb 4, 2026

    @ormsbee
    ContributorAuthor

    Yeah. If we think of LearningContext as "a context in which we will display learnable content (to learners OR authors) and be able to track user state/grades" (i.e. any context where we render XBlocks), then "content library", "blog post", "course", and perhaps "pathway" are all learning contexts.

    Agreed.

    If we define this "catalog" app as something like "core data/models to facilitate learner discovery and enrollment into enrollable things", then courses and pathways would be in scope for it, but other learning contexts like content libraries and the (theoretical) "blog post" context would not.

    So I think that "enrollable thing" is a good place to start the framing of it, with the catalog holding that piece and then the learning side controlling the later mapping from the enrollable thing into the learning context. But some wrinkles:

    1. We want roles to be mappable at the catalog layer.
    2. We should check with Product, but it seems reasonable to me to want to browse libraries or pre-provision roles for them in a manner similar to courses, even if they're not "enrollable" in the same way.

    The other part of this that we would really need Product input on is whether we want to shift further away from the 1:1 relationship of enrollable-thing -> learning context that we have today. If Enrollable is a openedx_catalog concept, and LearningContext is an openedx_learning concept, then it's possible that the mapping becomes 1:M, i.e. you enroll in a course and it grants you access to multiple runs. That would be a huge shift from what we have today and have a lot of knock-on effects, but the fact that we're separating the two might yield opportunities for more flexibility in less drastic increments.

  5. bradenmacdonald commented on Feb 4, 2026

    @bradenmacdonald
    Contributor

    So I think that "enrollable thing" is a good place to start the framing of it, with the catalog holding that piece and then the learning side controlling the later mapping from the enrollable thing into the learning context.

    Thinking on this more, I'm not so sure about that. It would make more sense to me if the concepts of "Enrollable" and "Enrollment" were part of a single enrollments app, not having "Catalog" own "Enrollable" and something else own "Enrollment". It also means that we have to add a layer of abstraction for "Enrollable" and "Enrollment", neither of which are abstract in the system today. Doing that abstraction in a way that's really flexible while also preserving simplicity and performance (for the 99.9% of use cases that are basic course enrollments) seems like too much to bite off ?

    What you think about these two options? Or anything else that comes to mind.

    Simple Option: Focus on Courses

    Enrollments are not abstract. The new openedx_catalog app is really just to provide the minimal core data required for other apps to reference courses when needed, and could in fact be better named openedx_courses. The existing enrollments app (common.djangoapps.student.models.course_enrollment + openedx.core.djangoapps.enrollments) would continue to work unchanged, but could/should be re-organized in the future.

    The goal of the openedx_courses app is to answer the question "what courses exist in the system?" for use by all other apps. It doesn't provide anything learner-oriented or discovery/enrollment oriented on its own.

    ---
    config:
      theme: 'forest'
    ---
    flowchart TB
        Catalog["**openedx_courses** (CourseRun, CatalogCourse plus core metadata models, e.g. CourseSchedule. Other metadata models live in other apps but are 1:1 with CourseRun.)"]
        Content["**openedx_content** (publishing, containers, components)"]
        Organizations["**edx-organizations** (Organization)"]
        Enrollments["**platform: enrollments** (CourseEnrollment, CourseEnrollmentAllowed)"]
        Modes["**platform: course_modes** (CourseMode)"]
        Catalog -. "If content, references an OutlineRoot" .-> Content
        Catalog -- References --> Organizations
        Enrollments -- References --> Modes
        Enrollments -- References --> Catalog
    
        style Enrollments fill:#ccc
        style Modes fill:#ccc
        style Organizations fill:#ccc
    
        Pathways["**openedx_pathways** (Pathway, PathwaySchedule, PathwayEnrollment, PathwayCertificate, etc.)"]
        Pathways -- References --> Catalog
    
        style Pathways fill:#c0ffee
    
        FutureCatalog["Future catalog service"] -- References --> Catalog
        FutureCatalog <-- Plugin API --> Pathways
        style FutureCatalog fill:#ffc0ee
    
    Loading

    Catalog Option: Focus on Enrollables

    Enrollments are abstract. The new openedx_catalog app exists to answer the question: "what enrollable things are available to me, as a learner?" In the future, it will have APIs for that, and plugins can control its behavior to implement things like subscriptions, enterprise, ecommerce, and various pathway types.

    ---
    config:
      theme: 'forest'
    ---
    flowchart TB
        Catalog["**openedx_catalog** (AbstractEnrollable, CourseRun, CatalogCourse, Pathway, plus core metadata models, e.g. EnrollableSchedule. Other metadata models live in other apps but are 1:1 with CourseRun.)"]
        Content["**openedx_content** (publishing, containers, components)"]
        Organizations["**edx-organizations** (Organization)"]
        Enrollments["**platform: enrollments** (Enrollment, EnrollmentAllowed, EnrollmentMode)"]
        Catalog -. "If it has content, then CourseRun references an OutlineRoot" .-> Content
        Catalog -- References --> Organizations
        Enrollments -- References --> Catalog
    
        style Enrollments fill:#ccc
        style Organizations fill:#ccc
    
        Pathways["**openedx_pathways** (PathwaySchedule, PathwayCertificate, etc.)"]
        Pathways <-- Plugin API --> Catalog
    
        style Pathways fill:#c0ffee
    
        FutureCatalog["Other catalog plugins (subscriptions, entitlements, ecommerce, etc.)"] <-- plugin API --> Catalog
        FutureCatalog -. May reference .-> Pathways
        style FutureCatalog fill:#ffc0ee
    
    Loading

    I think the "Simple Option" above is much more straightforward and probably a better evolution of what we have today; is it a good foundation for the future though? (I think so, but if we want lots of other enrollable things, maybe not).

    CC @kdmccormick @Agrendalath @mgwozdz-unicon

  6. ormsbee commented on Feb 4, 2026

    @ormsbee
    ContributorAuthor

    Enrollments are not abstract. The new openedx_catalog app is really just to provide the minimal core data required for other apps to reference courses when needed, and could in fact be better named openedx_courses.

    I'd strongly prefer the framing of calling it openedx_catalog because courses exist everywhere—there's going to be a publishable thing in openedx_content called a Course, for instance (distinct from an OutlineRoot, since it would want to capture things like grading policy, files and uploads, and more). I think that calling the model a Course and putting it in the framing of an openedx_catalog app conveys its meaning more accurately.

    The existing enrollments app (common.djangoapps.student.models.course_enrollment + openedx.core.djangoapps.enrollments) would continue to work unchanged, but could/should be re-organized in the future.

    I agree with this, FWIW. The first cut of this is to give CourseRun data representation in openedx-learning so that we can make foreign keys to it from other things in this repo, and make sure to keep that data in-sync by pushing data from the course_overviews app as necessary. Course enrollments are too complex for us to move over lightly. I think this is true regardless of which direction we want to go.

  7. ormsbee commented on Feb 4, 2026

    @ormsbee
    ContributorAuthor

    Other random comments...

    1. We may want to invert the relationship here between catalog and content, i.e. have openedx_content hold the mapping.
    2. We'll eventually want to add openedx-authz as a dependency for Pathway role information, though that's not a phase 1 concern since Pathways are just going to be set up by admins.
  8. bradenmacdonald commented on Feb 4, 2026

    @bradenmacdonald
    Contributor

    there's going to be a publishable thing in openedx_content called a Course, for instance (distinct from an OutlineRoot, since it would want to capture things like grading policy, files and uploads, and more).

    @ormsbee Ah, interesting. I guess I assumed that we wouldn't have a Course model in openedx_content, and that things like Schedule, Grading Policy, etc. would live in other apps (like openedx_catalog). Reason being that I assumed we'd want only a history log (via HistoricalRecords) rather than draft-publish workflow for those things. If each of them is a full-blown PublishableEntity with separate draft and published versions, then yeah that makes sense. (But it does complicate the plugin story for adding new course metadata models.)

    We may want to invert the relationship here between catalog and content, i.e. have openedx_content hold the mapping.

    Right. From what I put in the diagram above it could go either way. I think this does depend on where we see most of the metadata living - whether stuff like schedule and grading policy is in openedx_content or other apps.

  9. moved this from In Progress to Done in Libraries Overhaulon Mar 13, 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