Skip to content

Powering Penn Course Review, Penn Course Plan and Penn Course Alert

License

Notifications You must be signed in to change notification settings

NoamElul/penn-courses

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Penn Courses

Workflow Coverage Status

This is the unified home of all Penn Courses products.

Installation & Setup

  1. Install the backend
  2. If you need to, install the frontend

Note that you need the backend to run the frontend.

API Documentation

API Docs can be found at /api/documentation on the back-end server. Also check out the code for more explanations and documentation! We've tried to keep it up-to-date.

Runbook

This section is to collect thoughts/learnings from the codebase that have been hard-won, so we don't lose a record of it if and when the information proves useful again

Derived fields

Normally, derived fields on models are represented as @property-decorated functions. However, there are a few in the codebase that need to be accessed on the database layer without JOINs. So that they can be indexed. Specifically, these are the full_code fields on Course and Section models, which are derived from fields on related models.

These are updated every time the save() method is called. However, it's possible to get into a state (such as with db migrations) where full_code isn't set properly.

Open a shell in production, and run this small script:

from tqdm import tqdm
from courses.models import Section, Course

for c in tqdm(Course.objects.all().select_related("department")):
    c.save()

for s in tqdm(Section.objects.all().select_related("course")):
    s.save()

tqdm will give you a nice progress bar as the script completes. The select_related clause speeds up the query, avoiding what would be a pretty nasty N+1 scenario.

About

Powering Penn Course Review, Penn Course Plan and Penn Course Alert

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 67.1%
  • TypeScript 17.2%
  • JavaScript 12.8%
  • HTML 1.5%
  • CSS 1.3%
  • Dockerfile 0.1%