Пример #1
0
    class EntryForm(BaseEntryForm):
        rank = forms.ChoiceField(choices=RANK_CHOICES, required=True)
        step = forms.DecimalField(max_digits=4, decimal_places=2,
                                  help_text="Current salary step")
        base_salary = fields.AddSalaryField(help_text="Base annual salary for this rank + step.")
        add_salary = fields.AddSalaryField(label="Market Differential")
        add_pay = fields.AddPayField()

        def post_init(self):
            # find the last-known rank as a default
            if self.person:
                from faculty.models import CareerEvent
                event = CareerEvent.objects.filter(person=self.person, event_type='SALARY').effective_now().last()
                if event:
                    self.fields['rank'].initial = event.config['rank']
Пример #2
0
    class EntryForm(BaseEntryForm):

        STIPEND_SOURCES = Choices(
            ('RETENTION', 'Retention Award'),
            ('MARKETDIFF', 'Market Differential'),
            ('RESEARCH', 'Research Chair Stipend'),
            ('OTHER', 'Other'),
        )

        source = forms.ChoiceField(label='Stipend Source', choices=STIPEND_SOURCES)
        # Do we want this to be adjusted during leaves?
        amount = fields.AddSalaryField()