Overview
TheProgram model is the central model in the ESP Website, representing educational programs such as Splash, HSSP, Junction, and Delve. Each program instance has its own URL, grade range, modules, and settings.
Source: esp/esp/program/models/__init__.py:254
Model Fields
Unique URL identifier for the program (e.g., “Splash/2024”)
- Max length: 80 characters
- Must be unique across all programs
Display name of the program (e.g., “Splash 2024”)
- Max length: 80 characters
Minimum grade level allowed for student participation
Maximum grade level allowed for student participation
Director contact email address used for from field and display
- Default:
info@{SITE_INFO[1]} - Must end in your site domain or @learningu.org
- Max length: 75 characters
Carbon-copy address for automated outgoing mail (except class cancellations)
- If set, automated emails go here instead of director_email
- Use to avoid spamming director email with teacher registration emails
- Max length: 75 characters
Email address for confidential communications like financial aid applications
- If set, confidential emails go here instead of director_email
- Max length: 75 characters
Maximum number of students allowed to register
- Set to 0 for no cap
- Performance is best when no cap is set
Whether to enable waitlist functionality when program is full
- Default: False
Relationships
Set of enabled program functionalities
- Links to:
ProgramModule - See program modules documentation
Categories available for organizing classes in this program
- Links to:
ClassCategories - Blank allowed
Flag types that can be used to tag classes
- Links to:
ClassFlagType - Blank allowed
Media files and documents attached to the program
- Links to:
Media
Key Methods
URL Generation
Returns the admin URL for the programReturns:
/manage/{url}/mainExample:Returns the teacher-facing URLReturns:
/teach/{url}/Returns the student-facing URLReturns:
/learn/{url}/Returns the management URLReturns:
/manage/{url}/Returns the onsite URLReturns:
/onsite/{url}/User Queries
Returns dictionary of different sets of students for this programParameters:
QObjects(bool): If True, returns Q objects instead of querysets
Returns dictionary of different sets of teachers for this programParameters:
QObjects(bool): If True, returns Q objects instead of querysets
Returns dictionary of different sets of volunteers for this programParameters:
QObjects(bool): If True, returns Q objects instead of querysets
Utility Methods
Returns human-readable name of the programReturns: Value of the
name fieldReturns list of all grades eligible for the programReturns: List of integers from grade_min to grade_max (inclusive)Example:
Checks if this program uses student applicationsReturns: True if StudentAppQuestion objects exist for this programCached: Yes (depends on StudentAppQuestion model)
Properties
The type of program (first part of URL)Example: For url=“Splash/2024”, returns “Splash”
The specific instance identifier (remaining parts of URL)Example: For url=“Splash/2024”, returns “2024”
Usage Examples
Creating a New Program
Getting Students in a Program
Working with Program Modules
Accessing Program URLs
Related Models
- ClassSubject - Classes offered in a program
- User - Students, teachers, and administrators
- Registration - Student enrollments in classes
- Resources - Classrooms and equipment for the program