Changes between Initial Version and Version 1 of Ticket #21006


Ignore:
Timestamp:
Aug 30, 2013, 1:52:46 PM (11 years ago)
Author:
Tim Graham
Comment:

There's an example for modelformset_factory that uses the formset argument and while you might be able to infer a similar technique will work for inlineformset_factory since the docs say "Inline formsets is a small abstraction layer on top of model formsets", I agree an example could be helpful. I'm not sure it should be specific to the "Overriding clean()" section though, since the formset argument is useful for other cases as well.

If you could offer a patch, I'll be happy to review and commit it. Thanks!

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #21006

    • Property Triage Stage UnreviewedAccepted
    • Property Summary Overriding clean() on an InlineFormSetAdd an example of the formset argument for inlineformset_factory
    • Property Type UncategorizedCleanup/optimization
  • Ticket #21006 – Description

    initial v1  
    1010
    1111"See Overriding clean() on a ModelFormSet, but subclass BaseInlineFormSet rather than BaseModelFormSet. You must also specify which formset to use when creating your inlineformset in your view:"
    12 
     12{{{
    1313>>> from django.forms.models import inlineformset_factory
    14 >>> BookFormSet = inlineformset_factory(Author, Book''', formset= MyInlineFormSet''')
     14>>> BookFormSet = inlineformset_factory(Author, Book, formset= MyInlineFormSet)
    1515>>> author = Author.objects.get(name=u'Mike Royko')
    1616>>> formset = BookFormSet(instance=author)
    17 
     17}}}
Back to Top