Django

Code

Changeset 7728

Show
Ignore:
Timestamp:
06/23/08 07:57:11 (2 months ago)
Author:
russellm
Message:

Fixed #6891 -- Clarified modelform usage documentation. Thanks to Eric Holscher for the suggestion.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/docs/modelforms.txt

    r7411 r7728  
    183183    >>> a = Article.objects.get(pk=1) 
    184184    >>> f = ArticleForm(instance=a) 
     185    >>> f.save() 
     186 
     187    # Create a form to edit an existing Article, but use 
     188    # POST data to populate the form. 
     189    >>> a = Article.objects.get(pk=1) 
     190    >>> f = ArticleForm(request.POST, instance=a) 
     191    >>> f.save() 
    185192 
    186193Note that ``save()`` will raise a ``ValueError`` if the data in the form