'Returns the total number of forms in this FormSet.'

def total_form_count(self):

    if (self.data or self.files):
        return self.management_form.cleaned_data[TOTAL_FORM_COUNT]
    else:
        initial_forms = self.initial_form_count()
        total_forms = (initial_forms + self.extra)
        if (initial_forms > self.max_num >= 0):
            total_forms = initial_forms
        elif (total_forms > self.max_num >= 0):
            total_forms = self.max_num
    return total_forms
