Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Daniel W Bond
advisor
Commits
6224b923
Commit
6224b923
authored
Feb 15, 2014
by
Daniel W Bond
Browse files
studentupdateform should work
parent
d8d258f4
Changes
1
Show whitespace changes
Inline
Side-by-side
advisor/trajectories/forms.py
View file @
6224b923
from
django
import
forms
from
django.db
import
models
from
django.core.exceptions
import
ValidationError
from
django.forms
import
ModelForm
,
Select
from
trajectories.models
import
Trajectory
from
haystack.forms
import
SearchForm
...
...
@@ -34,7 +33,7 @@ class NewMajorForm( ModelForm ):
}
widgets
=
{
# name of major(s)
'name'
:
TextInput
(
attrs
=
{
'name'
:
forms
.
TextInput
(
attrs
=
{
'class'
:
'form-control'
,
'placeholder'
:
'Government and International Politics'
,
}),
...
...
@@ -54,7 +53,7 @@ class NewMinorForm( ModelForm ):
}
widgets
=
{
# name of minor(s)
'name'
:
TextInput
(
attrs
=
{
'name'
:
forms
.
TextInput
(
attrs
=
{
'class'
:
'form-control'
,
'placeholder'
:
'Software Engineering'
,
}),
...
...
@@ -80,22 +79,20 @@ class BuildTrajectoryForm( ModelForm ):
)
widgets
=
{
# name of the trajectory
'name'
:
TextInput
(
attrs
=
{
'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'
:
TextInput
(
attrs
=
{
'name'
:
forms
.
TextInput
(
attrs
=
{
'class'
:
'form-control'
,
'placeholder'
=
'Name Your Trajectory'
,
}),
}
class
StudentUpdateForm
(
ModelForm
):
# def __init__(self, *args, **kwargs):
class
Meta
:
model
=
Student
fields
=
(
'completedCourses'
,
'isHonors'
,
'semester'
,
...
...
@@ -109,20 +106,17 @@ class StudentUpdateForm( ModelForm ):
}
widgets
=
{
# 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'
,
'placeholder'
:
'Type in courses you
\'
ve taken'
,
#
'placeholder' : 'Type in courses you\'ve taken',
}),
# is the student honors?
'isHonors'
:
CheckboxInput
(
attrs
=
{
'isHonors'
:
forms
.
CheckboxInput
(
attrs
=
{
'class'
:
'form-control'
,
}),
# semester
'semester'
:
TextInput
(
attrs
=
{
'semester'
:
forms
.
TextInput
(
attrs
=
{
'class'
:
'form-control'
,
'placeholder'
:
'What year are you?'
}),
}
# def SelectCoursesForm ?
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment