Ticket #16467: formset_example.diff

File formset_example.diff, 689 bytes (added by teraom, 13 years ago)
  • docs/topics/forms/formsets.txt

     
    5959example::
    6060
    6161    >>> ArticleFormSet = formset_factory(ArticleForm, extra=2)
    62     >>> formset = ArticleFormSet(initial=[
    63     ...     {'title': u'Django is now open source',
    64     ...      'pub_date': datetime.date.today()},
    65     ... ])
     62    >>> formset = ArticleFormSet(initial={
     63    ...      'title': u'Django is now open source',
     64    ...      'pub_date': datetime.date.today(),
     65    ... })
    6666
    6767    >>> for form in formset:
    6868    ...     print form.as_table()
Back to Top