Commit 217af63d authored by Chris Reffett's avatar Chris Reffett
Browse files

changes

parent 40a57165
......@@ -32,7 +32,7 @@ class Semester(models.Model):
number = models.IntegerField("Semester Number")
user = models.ForeignKey(Student)
courses = models.ManyToManyField('Course', blank=True)
programs = models.ManyToManyField('Program')
programs = models.ManyToManyField('Program', related_name="progs+")
nextsemester = models.ForeignKey('self', blank=True, null=True)
requirementssatisfied = models.ManyToManyField('Requirement',
related_name="reqssatisfied+", blank=True,
......
......@@ -182,8 +182,12 @@ def genTrajectories(taken, programs, user):
if not taken:
taken = ['']
taken = set(taken)
sem = Semester(number=0, user=user, courses=taken,
programs=programs)
print taken
sem = Semester(number=0, user=user)
for takencourse in taken:
takencourse.semester=sem
sem.courses = taken
sem.programs = programs
tj = Trajectory(user=user, semesters=[sem])
programCourses = []
for program in 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