Commit f62d4d03 authored by Daniel W Bond's avatar Daniel W Bond
Browse files

buildtrajectoryform should be fixed

parent 6224b923
......@@ -59,36 +59,31 @@ class NewMinorForm( ModelForm ):
}),
}
# the user selects the courses they are allowed to take but
# this needs to be presented in a dramatically different way than
# just some silly dropdown
# build a trajectory
class BuildTrajectoryForm( ModelForm ):
# def __init__(self, *args, **kwargs):
class Meta:
model = Trajectory
fields = ('name', 'courses',
)
exclude = ('trajectorySlug', 'previousCourses', 'whichPrograms',
exclude = ('slug', 'owner', 'previousCourses', 'whichPrograms',
'isPublic', 'semester'
)
labels = (
labels = {
# the courses need to be sorted by their associated program, so idk labels
)
'name' : 'Trajectory Name',
'courses' : 'Courses You Can Take This Semester',
}
widgets = {
# name of the trajectory
# this should be generated automatically, e.g.
# Daniel's Music Theory and Biology Minor v. 4 Trajectory
'name' : forms.TextInput(attrs={
'class' : 'form-control',
# this shouldn't change often
'placeholder' = 'Name Your Trajectory',
}),
# course names... this isn't probably right
# users select and save tiles...
'name' : forms.TextInput(attrs={
# users select and save tiles... don't use the widget
'courses' : forms.SelectMultiple(attrs={
'class' : 'form-control',
'placeholder' = 'Name Your Trajectory',
}),
}
......@@ -105,7 +100,6 @@ class StudentUpdateForm( ModelForm ):
'semester' : 'Semester',
}
widgets = {
# this should be done above, but I don't know how that works with the models ^^^
'completedCourses' : forms.SelectMultiple(attrs={
'class' : 'form-control',
# 'placeholder' : 'Type in courses you\'ve taken',
......
......@@ -108,6 +108,8 @@ class GenEd(Program):
pass
class Trajectory(TimeStampedModel):
# This should be generated automatically, e.g. Daniel's Music Theory
# and Biology Minor v. 4 Trajectory
name = models.CharField(max_length = 150)
slug = AutoSlugField(populate_from='name',unique=True)
owner = models.ForeignKey(User)
......@@ -140,9 +142,8 @@ 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?
# aka username, etc should all be here
# does User have a slug field?
# all of the student's trajectories
trajectories = models.ManyToManyField('Trajectory', null=True)
......
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