Commit 6b7b9297 authored by Daniel W Bond's avatar Daniel W Bond
Browse files

moving things to make the forms work

parent a61a6f07
......@@ -6,7 +6,6 @@ from model_utils.models import TimeStampedModel
from autoslug import AutoSlugField
class Course(TimeStampedModel):
name = models.CharField(max_length = 150)
courseSlug = AutoSlugField(populate_from='name', unique=True)
......@@ -49,7 +48,6 @@ class Course(TimeStampedModel):
# gen eds are coursecollections in programs
class CourseCollection(TimeStampedModel):
name = models.CharField(max_length = 150)
# a number of courses
......@@ -68,20 +66,22 @@ class CourseCollection(TimeStampedModel):
isCompleted = models.BooleanField(False)
class Program(TimeStampedModel):
name = models.CharField(max_length = 150)
# change populate_from
slug = AutoSlugField(populate_from='name',unique=True)
# courseCollections
courseReqs = models.ManyToManyField('CourseCollection',)
# is BA, BS, Honors
# all majors must take a gened program, null for minors, geneds
# catalog year for the Program
catalogYear = models.DateField()
# if all coursecollections' and gened requirements are satisfied, then the
# if all coursecollections and gened requirements are satisfied, then the
# program is completed
# FINISH THIS
def isCompleted(courseReqs):
return True
isCompleted = models.BooleanField(False)
class Meta:
......@@ -108,7 +108,6 @@ class GenEd(Program):
pass
class Trajectory(TimeStampedModel):
name = models.CharField(max_length = 150)
slug = AutoSlugField(populate_from='name',unique=True)
owner = models.ForeignKey(User)
......@@ -140,7 +139,6 @@ class Trajectory(TimeStampedModel):
# should inherit from the standard Django User Model
class Student(models.Model):
user = models.OneToOneField(User)
# does User have a slug field?
......@@ -170,4 +168,3 @@ def create_user_profile(sender, instance, created, **kwargs):
Student.objects.create(user=instance)
post_save.connect(create_user_profile, sender=User)
......@@ -9,7 +9,8 @@ from braces.views import LoginRequiredMixin
# create a new trajectory
def newTrajectory(LoginRequiredMixin, CreateView):
model = Trajectory
form = CreateTrajectoryForm
form = NewMajorForm
form = NewMinorForm
# build the trajectory
def buildTrajectory(LoginRequiredMixin, UpdateView):
......@@ -40,7 +41,7 @@ def trajectoryDetail(LoginRequiredMixin, DetailView):
# lists all of your trajectories
def trajectoryList(LoginRequiredMixin, ListView):
model = Trajectory
# needs to make it so it's your trajectory
# needs to make it so it's only your trajectories
# or eventually, public as well
# lists all programs
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment