class TeachingCreditOverrideForm(forms.Form): teaching_credits = TeachingCreditField( help_text='May be a fraction eg. 2/3') reason = forms.CharField(required=False, max_length=70, widget=forms.TextInput(attrs={ 'size': 70, }))
class EntryForm(BaseEntryForm): CATEGORIES = Choices( ('BUYOUT', 'Course Buyout'), ('RELEASE', 'Teaching Release'), ('OTHER', 'Other'), ) category = forms.ChoiceField(label='Type', choices=CATEGORIES) teaching_credits = TeachingCreditField() reason = forms.CharField(max_length=255, required=False) funded_by = forms.CharField(label='Funded By', max_length=255, required=False) approved_by = forms.CharField(label='Approved By', max_length=255, required=False)
class EntryForm(BaseEntryForm): POSITIONS = Choices( ('UGRAD_DIRECTOR', 'Undergrad Program Director'), ('GRAD_DIRECTOR', 'Graduate Program Director'), ('DDP_DIRECTOR', 'Dual-Degree Program Director'), ('ASSOC_DIRECTOR', 'Associate Director/Chair'), ('DIRECTOR', 'School Director/Chair'), ('ASSOC_DEAN', 'Associate Dean'), ('DEAN', 'Dean'), ('OTHER', 'Other Admin Position'), ) position = forms.ChoiceField(required=True, choices=POSITIONS) teaching_credit = TeachingCreditField(required=False, initial=None)
class EntryForm(BaseEntryForm): position = forms.ChoiceField(required=True, choices=[]) add_salary = AddSalaryField(required=False) add_pay = AddPayField(required=False) teaching_credit = TeachingCreditField(required=False) def post_init(self): # set the allowed position choices from the config from allowed units choices = FellowshipEventHandler.get_fellowship_choices(self.units, only_active=True) self.fields['position'].choices = choices def clean(self): data = self.cleaned_data if 'unit' not in data: raise forms.ValidationError("Couldn't check unit for fellowship ownership.") choices = FellowshipEventHandler.get_fellowship_choices([data['unit']], only_active=True) found = [short for short,long in choices if short == data['position']] if not found: raise forms.ValidationError("That fellowship is not owned by the selected unit.") return data
class EntryForm(BaseEntryForm): credit = TeachingCreditField(label='Teaching Credit', initial=2)