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
97459123
Commit
97459123
authored
Feb 02, 2014
by
Daniel W Bond
Browse files
changed forms and models for trajectory
parent
4cb0d9bd
Changes
2
Show whitespace changes
Inline
Side-by-side
advisor/trajectories/forms.py
View file @
97459123
...
...
@@ -19,6 +19,8 @@ class StyledSeachForm( SearchForm ):
# class SelectYourCourses( ModelForm ):
# needs to connect with a Student's completedCourses field
# class Meta:
# models = Course
...
...
@@ -28,6 +30,7 @@ class StyledSeachForm( SearchForm ):
# course number
# name
# }
class
NewTrajectoryForm
(
ModelForm
):
# def __init__(self, *args, **kwargs):
...
...
@@ -58,6 +61,35 @@ class NewTrajectoryForm( ModelForm ):
}
# class CreateTrajectoryForm ( ModelForm ):
# def __init__(self, *args, **kwargs):
# 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
class
Meta
:
model
=
Trajectory
fields
=
(
'name'
,
'courses'
,
)
exclude
=
(
'trajectorySlug'
,
'previousCourses'
,
'whichPrograms'
,
'isPublic'
,
'semester'
)
labels
=
(
# the courses need to be sorted by their associated program, so idk labels
)
widgets
=
{
# name of the trajectory
'name'
:
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
=
{
'class'
:
'form-control'
,
'placeholder'
=
'Name Your Trajectory'
,
}),
}
class
StudentInfoForm
(
ModelForm
):
# def __init__(self, *args, **kwargs):
...
...
@@ -77,11 +109,11 @@ class StudentInfoForm( ModelForm ):
# this should be done above, but I don't know how that works with the models ^^^
'completedCourses'
:
TextInput
(
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
=
{
'class'
=
'form-control'
,
'class'
:
'form-control'
,
}),
# semester
...
...
advisor/trajectories/models.py
View file @
97459123
...
...
@@ -144,6 +144,9 @@ class Trajectory(BaseModel):
# Takes courses
previousCourses
=
models
.
ManyToManyField
(
'Trajectory'
,)
# the newly added courses for that trajectory
courses
=
models
.
ManyToManyField
(
'Course'
,)
# def getPreviousTrajectory(Trajectory):
# return Trajectory
...
...
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