Minor typos in "Passing arguments to the form constructor" documentation
BigglesZX opened this issue · 2 comments
BigglesZX commented
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
Please send PR!
BigglesZX commented
Done, thanks for the prompt :)