Commit 6d839006 authored by Daniel W Bond's avatar Daniel W Bond
Browse files

getting things ready for playing with js field

parent 36370e4f
......@@ -19,10 +19,10 @@ class StudentUpdateForm(forms.Form):
gender = MultiSelectFormField(choices=Student.GENDER_CHOICES,
label='Gender Identity (please choose all that apply)')
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=''))
#neighborhood = forms.ChoiceField(choices=Building.NEIGHBOURHOOD_CHOICES)
#building = forms.ModelChoiceField(queryset=Building.objects.filter(neighbourhood=neighborhood)
#floor = forms.ModelChoiceField(queryset=Floor.objects.filter(building=building)
#room = forms.ModelChoiceField(queryset=Room.objects.filter(floor=floor))
privacy = forms.ChoiceField(choices=Student.PRIVACY_CHOICES)
major = forms.ModelChoiceField(queryset=Major.objects.all())
......
......@@ -18,7 +18,7 @@ class Building(TimeStampedModel):
RAPPAHANNOCK = 'ra'
SHENANDOAH = 'sh'
NEIGHBOURHOOD_CHOICES = (
(NONE, 'None'),
(NONE, '---'),
(AQUIA, 'Aquia'),
(RAPPAHANNOCK, 'Rappahannock'),
(SHENANDOAH, 'Shenandoah'),
......@@ -33,7 +33,7 @@ class Building(TimeStampedModel):
MASONVALE = 'mv'
FAIRFAX = 'ff'
CAMPUS_CHOICES = (
(NONE, 'None'),
(NONE, '---'),
(PRINCE_WILLIAM, 'Prince William'),
(MASONVALE, 'MasonVale'),
(FAIRFAX, 'Fairfax'),
......
/*! Chained 1.0.0 - MIT license - Copyright 2010-2014 Mika Tuupola */
!function(a,b){"use strict";a.fn.chained=function(c){return this.each(function(){function d(){var d=!0,g=a("option:selected",e).val();a(e).html(f.html());var h="";a(c).each(function(){var c=a("option:selected",this).val();c&&(h.length>0&&(h+=b.Zepto?"\\\\":"\\"),h+=c)});var i;i=a.isArray(c)?a(c[0]).first():a(c).first();var j=a("option:selected",i).val();a("option",e).each(function(){a(this).hasClass(h)&&a(this).val()===g?(a(this).prop("selected",!0),d=!1):a(this).hasClass(h)||a(this).hasClass(j)||""===a(this).val()||a(this).remove()}),1===a("option",e).size()&&""===a(e).val()?a(e).prop("disabled",!0):a(e).prop("disabled",!1),d&&a(e).trigger("change")}var e=this,f=a(e).clone();a(c).each(function(){a(this).bind("change",function(){d()}),a("option:selected",this).length||a("option",this).first().attr("selected","selected"),d()})})},a.fn.chainedTo=a.fn.chained,a.fn.chained.defaults={}}(window.jQuery||window.Zepto,window,document);
\ No newline at end of file
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