AndrewIngram/django-extra-views

Rename get_formset -> get_formset_class

jonashaag opened this issue · 2 comments

formset_class = self.get_formset()

That's a bit weird and inconsistent, it's called get_form_class in Django's views and I guess get_formset_class is more correct?

There's duplication of that method name due to the use of an intermediate factory method by Django. We first get a formset class from get_formset_class(), then pass that into formset_factory to get another formset class, then use that class in order to construct a formset instance.

We could rename it like this:

factory_class = self.get_factory_class()
or
factory_formset_class = self.get_factory_formset_class()

to indicate this is the formset class which comes back from the factory, with a deprecation warning on the old name. I'm not sure if the rename makes things any clearer though. What do you think?

Agreed, root of the naming problem is in Django, not something we should fix here.