Strategy to add a new model that references the Course Model

Our team is working on adding new model to the admin screen to allow our admins to “lock” a course.

The basic functionality would be:

  • Admin logs into admin panel
  • Admin clicks the add course to the locked model
  • Admin is able to search for the course
  • Admin saves the course to the “lock” model

Currently we have the following link to the course:

course_id = CourseKeyField(db_index=True, primary_key=True, max_length=255)

With this approach I don’t believe the admin screen will automatically pull in the course model to allow our users to select the course.

I was wondering if this is the preferred approach?

Or, would it be better to add a foreign key to the CourseOverview?

models.ForeignKey(
        CourseOverview,
        db_constraint=False,
        db_index=True,
        related_name='modes',
        on_delete=models.DO_NOTHING,
    )

Our team was a little hesitant on the foreignkey approach after reading the following article:

https://github.com/openedx/edx-platform/wiki/Opaque-Keys-(Locators)#utilizing-keys

Goal:
Allow our admins to use the admin screens to select a course and save it into a new table. We would like to allow them to search the course and not need to know what the “key” is. We would then add more logic throughout the application to look at this model to determine how to show the courses.

Thanks in advance for any suggestions!