Commit 6224b923 authored by Daniel W Bond's avatar Daniel W Bond
Browse files

studentupdateform should work

parent d8d258f4
from django import forms from django import forms
from django.db import models from django.db import models
from django.core.exceptions import ValidationError from django.core.exceptions import ValidationError
from django.forms import ModelForm, Select
from trajectories.models import Trajectory from trajectories.models import Trajectory
from haystack.forms import SearchForm from haystack.forms import SearchForm
...@@ -34,7 +33,7 @@ class NewMajorForm( ModelForm ): ...@@ -34,7 +33,7 @@ class NewMajorForm( ModelForm ):
} }
widgets = { widgets = {
# name of major(s) # name of major(s)
'name' : TextInput(attrs={ 'name' : forms.TextInput(attrs={
'class' : 'form-control', 'class' : 'form-control',
'placeholder' : 'Government and International Politics', 'placeholder' : 'Government and International Politics',
}), }),
...@@ -54,7 +53,7 @@ class NewMinorForm( ModelForm ): ...@@ -54,7 +53,7 @@ class NewMinorForm( ModelForm ):
} }
widgets = { widgets = {
# name of minor(s) # name of minor(s)
'name' : TextInput(attrs={ 'name' : forms.TextInput(attrs={
'class' : 'form-control', 'class' : 'form-control',
'placeholder' : 'Software Engineering', 'placeholder' : 'Software Engineering',
}), }),
...@@ -80,22 +79,20 @@ class BuildTrajectoryForm( ModelForm ): ...@@ -80,22 +79,20 @@ class BuildTrajectoryForm( ModelForm ):
) )
widgets = { widgets = {
# name of the trajectory # name of the trajectory
'name' : TextInput(attrs={ 'name' : forms.TextInput(attrs={
'class' : 'form-control', 'class' : 'form-control',
# this shouldn't change often # this shouldn't change often
'placeholder' = 'Name Your Trajectory', 'placeholder' = 'Name Your Trajectory',
}), }),
# course names... this isn't probably right # course names... this isn't probably right
# users select and save tiles... # users select and save tiles...
'name' : TextInput(attrs={ 'name' : forms.TextInput(attrs={
'class' : 'form-control', 'class' : 'form-control',
'placeholder' = 'Name Your Trajectory', 'placeholder' = 'Name Your Trajectory',
}), }),
} }
class StudentUpdateForm( ModelForm ): class StudentUpdateForm( ModelForm ):
# def __init__(self, *args, **kwargs):
class Meta: class Meta:
model = Student model = Student
fields = ('completedCourses', 'isHonors', 'semester', fields = ('completedCourses', 'isHonors', 'semester',
...@@ -109,20 +106,17 @@ class StudentUpdateForm( ModelForm ): ...@@ -109,20 +106,17 @@ class StudentUpdateForm( ModelForm ):
} }
widgets = { widgets = {
# this should be done above, but I don't know how that works with the models ^^^ # this should be done above, but I don't know how that works with the models ^^^
'completedCourses' : TextInput(attrs={ 'completedCourses' : forms.SelectMultiple(attrs={
'class' : 'form-control', 'class' : 'form-control',
'placeholder' : 'Type in courses you\'ve taken', # 'placeholder' : 'Type in courses you\'ve taken',
}), }),
# is the student honors? # is the student honors?
'isHonors' : CheckboxInput(attrs={ 'isHonors' : forms.CheckboxInput(attrs={
'class' : 'form-control', 'class' : 'form-control',
}), }),
# semester # semester
'semester' : TextInput(attrs={ 'semester' : forms.TextInput(attrs={
'class' : 'form-control', 'class' : 'form-control',
'placeholder' : 'What year are you?' 'placeholder' : 'What year are you?'
}), }),
} }
# def SelectCoursesForm ?
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