def __init__(self, *args, **kwargs):
        # Have to pop these off before sending to the super constructor
        round_object = kwargs.pop('round_instance')
        no_fill = False
        if 'no_fill' in kwargs:
            kwargs.pop('no_fill')
            no_fill = True
        super(ResultEntryForm, self).__init__(*args, **kwargs) 
        # If we already have information, fill that into the form
        if round_object.victor != 0 and not no_fill:
            self.fields["winner"].initial = round_object.victor

        self.fields['round_instance'] = forms.IntegerField(initial=round_object.pk,
                                                           widget=forms.HiddenInput())
        gov_team, opp_team = round_object.gov_team, round_object.opp_team
        gov_debaters = [(-1,'---')]+[(d.id, d.name) for d in gov_team.debaters.all()]
        opp_debaters = [(-1,'---')]+[(d.id, d.name) for d in opp_team.debaters.all()]

        # TODO: Combine these loops?
        for d in self.GOV:
            self.fields["%s_debater"%(d)] = forms.ChoiceField(label="Who was %s?"%(self.NAMES[d]), choices=gov_debaters)
            self.fields["%s_speaks"%(d)] = forms.DecimalField(label="%s Speaks"%(self.NAMES[d]),validators=[validate_speaks])
            self.fields["%s_ranks"%(d)] = forms.ChoiceField(label="%s Rank"%(self.NAMES[d]), choices=self.RANKS)
        for d in self.OPP:
            self.fields["%s_debater"%(d)] = forms.ChoiceField(label="Who was %s?"%(self.NAMES[d]), choices=opp_debaters)
            self.fields["%s_speaks"%(d)] = forms.DecimalField(label="%s Speaks"%(self.NAMES[d]),validators=[validate_speaks])
            self.fields["%s_ranks"%(d)] = forms.ChoiceField(label="%s Rank"%(self.NAMES[d]), choices=self.RANKS)
        if round_object.victor != 0 and not no_fill:
            for d in self.GOV + self.OPP:
                try:
                    stats = RoundStats.objects.get(round=round_object, debater_role = d)
                    self.fields["%s_debater"%(d)].initial = stats.debater.id
                    self.fields["%s_speaks"%(d)].initial = stats.speaks
                    self.fields["%s_ranks"%(d)].initial = int(round(stats.ranks))
                except:
                    pass
dataset/ETHPy150Open jolynch/mit-tab/mittab/apps/tab/forms.py/ResultEntryForm.__init__/original