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
SRCT
roomlist
Commits
8d41f6d9
Commit
8d41f6d9
authored
Nov 08, 2015
by
Daniel W Bond
Browse files
no idea what I'm doing with the room filtering on the form
parent
0d448511
Changes
1
Hide whitespace changes
Inline
Side-by-side
roomlist/accounts/forms.py
View file @
8d41f6d9
...
...
@@ -9,6 +9,7 @@ from crispy_forms.bootstrap import PrependedText, AppendedText
from
multiselectfield
import
MultiSelectFormField
# imports from your apps
from
.models
import
Student
,
Room
,
Major
from
housing.models
import
Building
class
StudentUpdateForm
(
forms
.
Form
):
...
...
@@ -17,7 +18,12 @@ class StudentUpdateForm(forms.Form):
last_name
=
forms
.
CharField
(
label
=
'Last Name'
)
gender
=
MultiSelectFormField
(
choices
=
Student
.
GENDER_CHOICES
,
label
=
'Gender Identity (please choose all that apply)'
)
room
=
forms
.
ModelChoiceField
(
queryset
=
Room
.
objects
.
all
())
neighborhood
=
forms
.
ChoiceField
(
choices
=
Building
.
NEIGHBOURHOOD_CHOICES
)
building
=
forms
.
ModelChoiceField
(
queryset
=
Building
.
objects
.
filter
(
neighbourhood
=
''
)
floor
=
forms
.
ModelChoiceField
(
queryset
=
Floor
.
objects
.
filter
(
building
=
''
)
room
=
forms
.
ModelChoiceField
(
queryset
=
Room
.
objects
.
filter
(
floor
=
''
))
privacy
=
forms
.
ChoiceField
(
choices
=
Student
.
PRIVACY_CHOICES
)
major
=
forms
.
ModelChoiceField
(
queryset
=
Major
.
objects
.
all
())
graduating_year
=
forms
.
IntegerField
(
label
=
'Graduating Year'
)
...
...
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