AndrewIngram / django-extra-views

Django's class-based generic views are awesome, let's have more of them.
MIT License
1.38k stars 172 forks source link

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

Closed BigglesZX closed 5 years ago

BigglesZX commented 5 years ago
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)

jonashaag commented 5 years ago

Please send PR!

BigglesZX commented 5 years ago

Done, thanks for the prompt :)