Ticket #6891: 6891.diff

File 6891.diff, 591 bytes (added by Jeff Anderson, 16 years ago)

worked up a patch

  • docs/modelforms.txt

    diff --git a/docs/modelforms.txt b/docs/modelforms.txt
    index a76d797..b6c993b 100644
    a b supplied, ``save()`` will update that instance. If it's not supplied,  
    183183    >>> a = Article.objects.get(pk=1)
    184184    >>> f = ArticleForm(instance=a)
    185185
     186    # Take POST data and modify an existing Article.
     187    >>> a = Article()
     188    >>> f = ArticleForm(request.POST, instance=a)
     189    >>> new_article = f.save()
     190
    186191Note that ``save()`` will raise a ``ValueError`` if the data in the form
    187192doesn't validate -- i.e., ``if form.errors``.
    188193
Back to Top