def make_choiceformset(self, formset_data=None, formset_class=ChoiceFormSet,
        total_forms=None, initial_forms=0, max_num_forms=0, **kwargs):
        kwargs.setdefault('prefix', 'choices')
        kwargs.setdefault('auto_id', False)

        if formset_data is None:
            return formset_class(**kwargs)

        if total_forms is None:
            total_forms = len(formset_data)

        def prefixed(*args):
            args = (kwargs['prefix'],) + args
            return '-'.join(args)

        data = {
            prefixed('TOTAL_FORMS'): str(total_forms),
            prefixed('INITIAL_FORMS'): str(initial_forms),
            prefixed('MAX_NUM_FORMS'): str(max_num_forms),
        }
        for i, (choice, votes) in enumerate(formset_data):
            data[prefixed(str(i), 'choice')] = choice
            data[prefixed(str(i), 'votes')] = votes

        return formset_class(data, **kwargs)
Utility method to create a table for weapons
dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/Django-1.6.10/tests/forms_tests/tests/test_formsets.py/FormsFormsetTestCase.make_choiceformset--crossover with--dataset/ETHPy150Open tuturto/pyherc/src/herculeum/sphinx/items.py/make_weapon_table