AndrewIngram/django-extra-views

Minor typos in "Passing arguments to the form constructor" documentation

BigglesZX opened this issue · 2 comments

from extra_views import InlineFormSetFactory

class ItemInline(InlineFormSetFactory):
    model = Item

    def get_formset_kwargs():
        kwargs = super(ItemInline, self).get_formset_kwargs()
        initial = get_some_initial_values()
        kwargs['form_kwargs'].update({'initial': initial}}
        return kwargs

Should read:

from extra_views import InlineFormSetFactory

class ItemInline(InlineFormSetFactory):
    model = Item

    def get_formset_kwargs(self):
        kwargs = super(ItemInline, self).get_formset_kwargs()
        initial = get_some_initial_values()
        kwargs['form_kwargs'].update({'initial': initial})
        return kwargs

(Missing self argument and mismatched brackets in update)

Please send PR!

Done, thanks for the prompt :)