Skip to content

Instantly share code, notes, and snippets.

@bdarcus
Created May 20, 2009 18:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bdarcus/115011 to your computer and use it in GitHub Desktop.
Save bdarcus/115011 to your computer and use it in GitHub Desktop.
from django.db import models
# an outline of a model for a course
# an umbrella organization (school, etc.)?
class AcademicSession(models.Model):
"""
A block of time (such as a semester) during which courses may be
offered.
"""
year = # not sure how to do this in Django
term = # need to allow flexibilty here; quarters vs. semesters vs. "weird stuff"
class Course(models.Model):
"""
An abstract course.
"""
title = models.CharField(max_length=250)
subtitle = models.CharField(max_length=250, null=True, blank=True)
slug = models.SlugField(prepopulate_from=('title',))
description = models.TextField(null=True, blank=True)
outcomes = models.ManyToManyField(Outcome)
class Outcome(models.Model):
"""
An outcome.
"""
name = models.CharField(max_length=250)
description = models.TextField(null=True, blank=True)
class CourseOffering(models.Model):
"""
A course instance, as offered by a particular instructor or set of
instructors, in a particular AcademicSession.
"""
session
course
instructors
students
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment